Denominator
Hard
Execution time limit is 1 second
Runtime memory usage limit is 256 megabytes
Determine the number of proper fractions with denominators not exceeding .
A fraction is considered proper if:
and are positive integers;
;
the greatest common divisor (GCD) of and is .
Input
The input consists of a single integer ().
Output
Output a single integer representing the number of proper fractions.
Examples
Input #1
Answer #1
Input #2
Answer #2
Scoring
( points): ;
( points): ;
( points): no additional constraints.
Submissions 305
Acceptance rate 16%