IntermediateRating 1300
Coprime Numbers
Count the integers from 1 to n that are coprime to n (Euler's totient φ(n)).
Input
One integer n (1 ≤ n ≤ 10¹²).
Output
φ(n).
Sample 1
Input
9
Output
6
Sample 2
Input
1
Output
1
Output appears hereOne integer n (1 ≤ n ≤ 10¹²).
φ(n).
9
6
1
1
Output appears here