Determine the number of proper fractions with denominators not exceeding .
A fraction \frac{a}{b} is considered proper if:
and are positive integers;
a \leq b;
the greatest common divisor (GCD) of and is .
The input consists of a single integer (1 \leq n \leq 10^6).
Output a single integer representing the number of proper fractions.
Example 1
Example 2
( points): n \leq 10^3;
( points): n \leq 10^5;
( points): no additional constraints.