F. Shortest GCD Paths
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given three integers $$$n$$$, $$$a$$$, $$$b$$$. Consider a weighted undirected graph with $$$n$$$ vertices, where for every pair of distinct vertices $$$(u, v)$$$ there is an edge with weight:

$$$$$$ w(u, v) = \frac{\max(u, v)}{\gcd(u, v)} $$$$$$

Here $$$\gcd(x, y)$$$ denotes the greatest common divisor (GCD) of integers $$$x$$$ and $$$y$$$.

Find the shortest path from vertex $$$a$$$ to vertex $$$b$$$ in this graph.

Input

The only line contains three integers $$$n$$$, $$$a$$$, $$$b$$$ ($$$2 \le n \le 10^{9}, 1 \le a, b \le n, a \neq b$$$).

Output

Print one integer — the length of the shortest path from vertex $$$a$$$ to vertex $$$b$$$.

Examples
Input
10 9 8
Output
7
Input
100 16 27
Output
10
Input
100 55 11
Output
5
Note

Consider the first example.

The shortest path in it is $$$9 \to 6 \to 8$$$ with total cost $$$w(9, 6) + w(6, 8) = 3 + 4 = 7$$$.