LogiQuest

146. Euler's Totient

MediumTotient

Print φ(n): how many integers in 1..n are coprime with n.

Input format

A single integer n.

Output format

φ(n)

Example 1

Input

9

Output

6

Example 2

Input

1

Output

1

Constraints

1 ≤ n ≤ 10¹²

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…