#arc159b. [arc159_b]GCD Subtraction

[arc159_b]GCD Subtraction

Problem Statement

We have variables aa and bb. Initially, a=Aa=A and b=Bb=B.

Takahashi will repeat the following operation while both aa and bb are greater than or equal to 11.

  • Let gg be the greatest common divisor of aa and bb, and replace aa and bb with aga-g and bgb-g, respectively.

How many times will he perform the operation?

Constraints

  • 1leqA,Bleq10121 \\leq A,B \\leq 10^{12}
  • AA and BB are integers.

Input

The input is given from Standard Input in the following format:

AA BB

Output

Print the answer.


Sample Input 1

15 9

Sample Output 1

2

We start with a=15,b=9a=15,b=9 and perform the following.

  • Let g=3g=3, and replace aa and bb with 12(=153)12(=15-3) and 6(=93)6(=9-3), respectively.
  • Let g=6g=6, and replace aa and bb with 6(=126)6(=12-6) and 0(=66)0(=6-6), respectively. bb is no longer greater than or equal to 11, so the iteration terminates.

Sample Input 2

1 1

Sample Output 2

1

Sample Input 3

12345678910 10987654321

Sample Output 3

36135