Hippodrome#5989

Hippodrome

1 second
64 megabytes
Very hard

In a circular stadium with a circumference of meters, there are n-1 horses racing. Each horse is numbered from to n-1 inclusive. The -th horse starts meters from the starting line, in the direction of the race, and runs i^2 meters. A horse is deemed successful if it finishes exactly at the starting line.

Determine how many horses are successful for a given .

Input

The input consists of a single line containing the integer (3 \leq n \leq 10^{18}), which represents the circumference of the stadium.

Output

Output a single integer — the number of successful horses.

Examples

Example 1

Loading
Loading