Limits 1s, 512 MB

Given a positive integer NN, determine how many of the integers between 1 and NN are co-prime with NN.

Two numbers are co-prime if the only common positive factor of the two numbers is 1.

Input

The input will contain one integer NN (0<N<100000000 < N < 10000000).

Output

Print a single integer--the number of integers between 1 and NN that are co-prime with NN.

Samples

InputOutput
15
8
InputOutput
20
8

Submit

Login to submit.

Statistics

89% Solution Ratio
identityEarliest, Sep '19
identityFastest, 0.0s
identityLightest, 0 B
touhidurrrShortest, 71B
Toph uses cookies. By continuing you agree to our Cookie Policy.