Euler Totient Function

3.9

7 votes
Very-Easy
Problem

In number theory, the totient Φ of a positive integer N is defined as the number of positive integers less than or equal to N that are co-prime to N.

Given an integer N. Compute the value of the totient Φ.

Input:
First and the only line of input contains single integer N.

Output:
Print the Φ(N) in a single line.

Constraints:
1N1000000

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?