Codeforces Round 174 (Div. 2)
翻译中…
The cows have just learned what a primitive root is! Given a prime $*p*$, a primitive root
is an integer $*x*$ $(1 ≤ *x* < *p*)$ such that none of integers $*x* - 1, *x*^{2} - 1, ..., *x*^{*p* - 2} - 1$ are divisible by $*p*$, but $*x*^{*p* - 1} - 1$ is.
翻译中…
Unfortunately, computing primitive roots can be time consuming, so the cows need your help. Given a prime $*p*$, help the cows find the number of primitive roots
.
翻译中…
Input
翻译中…
The input contains a single line containing an integer $*p*$ $(2 ≤ *p* < 2000)$. It is guaranteed that $*p*$ is a prime.
翻译中…
Output
翻译中…
Output on a single line the number of primitive roots
.
翻译中…
Note
翻译中…
The only primitive root
is $2.$
翻译中…
The primitive roots
are $2$ and $3.$
翻译中…
样例
Input #1
3
Output #1
1
InputCopy
OutputCopy
Input #2
5
Output #2
2
InputCopy
OutputCopy
题目信息
标签
模拟
数学
数论
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。