One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm  ×  b mm sheet of paper (a > b). Usually the first step in making an origami is making a square piece of paper from the rectangular sheet by folding the sheet along the bisector of the right angle, and cutting the excess part.

 [Image] 

After making a paper ship from the square piece, Vasya looked on the remaining (a - b) mm  ×  b mm strip of paper. He got the idea to use this strip of paper in the same way to make an origami, and then use the remainder (if it exists) and so on. At the moment when he is left with a square piece of paper, he will make the last ship from it and stop.

Can you determine how many ships Vasya will make during the lesson?


-----Input-----

The first line of the input contains two integers a, b (1 ≤ b < a ≤ 10^12) — the sizes of the original sheet of paper.


-----Output-----

Print a single integer — the number of ships that Vasya will make.


-----Examples-----
Input
2 1

Output
2

Input
10 7

Output
6

Input
1000000000000 1

Output
1000000000000



-----Note-----

Pictures to the first and second sample test.

 [Image]

Difficulty: interview

Starter code:

Solutions:
a, b = list(map(int, input().split()))

ans = 0

while a and b:
    if a > b:
        ans += a // b
        a = a % b
    else:
        ans += b // a
        b = b % a

print(ans)


a,b=map(int,input().split())
ans=0
a,b=max(a,b),min(a,b)
while b!=0:
    ans+=a//b
    a,b=b,a%b
print(ans)

#!/usr/bin/env python3

a, b = list(map(int, input().split(' ')))

ships_num = 0

while b != 0:
    ships_num += a // b
    a, b = b, a % b

print(ships_num)


def gcd(x, y):
    counter = 0
    while y != 0:
        counter += x // y
        x, y = y, x % y
    return counter

x, y = map(int, input().split())
print(gcd(x, y))

a, b = list(map(int, str.split(input())))
count = 0
while a and b:

    a, b, count = b, a % b, count + a // b

print(count)


a, b = list(map(int, input().split()))

res = 0

while a > 0 and b > 0 and a != b:
    res += a // b
    a, b = b, a % b

print(res)


def main():
      a, b = list(map(int, input().split()))
      count = 0
      mx = max(a,b)
      while  a:
        if a < b:
            a,b=b,a
        less = a // b
        count += less
        a -= b*less
      print(count)
def __starting_point():
    main()

__starting_point()

a, b = [int(i) for i in input().split()]
a, b = min(a, b), max(a, b)

result = 0
while a != b:
    a, b = min(a, b), max(a, b) 
    result += (b - 1) // a
    b -= (b - 1) // a * a
    
print(result + 1)


a, b = map(int, input().split())

ans = 0 
while True:
    if a == 0 or b == 0:
        break

    if a < b:
        a,b = b, a

    ans += a//b
    a = a % b

print(ans)

def f(a, b):
    if a % b > 0:
        return int(a / b) + f(b, a % b)
    return int(a / b)

a, b = list(map(int,input().split()))
print(f(a, b))




import sys
n,m = list(map(int,input().split(' ')))

answer = 0
if n==1 or m==1 :
    print(n*m)
    return
while n>0 and m>0 :
    if n>m :
        answer+= int(n/m)
        n %=m
    else :
        answer += int(m/n)
        m %=n
print(answer)


a, b = list(map(int, input().split()))
num = 0
while b > 0:
    temp = b
    num += (a // b)
    b = a % b
    a = temp
print(num)
    


def fun(a, b):
    cnt = 0
    while(True):
        cnt += a // b
        tmp = a
        a = b
        b = tmp % b
        if b == 0:
            break
    return cnt

a, b = [int(c) for c in input().split()]
print(fun(a, b))

def cnt(a, b):
    if (a < b):
        a, b = b, a
    if b == 0:
        return 0
    if a == b:
        return 1
    return a // b + cnt(b, a % b)

a, b = map(int, input().split())
print(cnt(a, b))

def main():
	a, b = list(map(int, input().split()))
	count = 0
	while a % b != 0 :
		count += (a//b)
		
		a = a % b
		if a < b:
			a, b = b, a
	count += a // b
	print(count )

def __starting_point():
	main()
		



__starting_point()


my_str = input().split()
a, b = int(my_str[0]), int(my_str[1])
c = 0
while a>b and b>0:
    t = a
    a = b
    c += int(t/b)
    b = t % b
    if b>a:
        t = a
        a = b
        b = t
print (c)


#!/c/Python34/python
# coding: utf-8


def main():
    [a, b] = list(map(int, input().split()))
    ans = 0

    while 1:
        if a > b:
            ans += a//b
            if a % b == 0:
                break
            a = a % b
        else:
            ans += b//a
            if b % a == 0:
                break
            b = b % a

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

f = lambda: input()

a,b = list(map(int, f().split()))
c = 0
while( a != b and a != 0 and b != 0):
    lo = min(a, b)
    hi = max(a, b)
    a = hi % lo
    b = lo
    c += int(hi / lo)

print(c)


a,b = (list(map(int, input().split())))
count = 0

while ((b != 0) and (a != 0)):
    if b>a:
        count = count + b//a
        b = b%a
        a = a
    elif b<a:
        count = count + a//b
        b = b
        a = a%b

    

print(count)


a,b = map(int,input().split())

def f(a,b):
    if a==b:
        return 1
    elif a==0 or b==0:
        return 0
    else:
        return a//b + f(max(a-b*(a//b),b),min(a-b*(a//b),b))

print(f(a,b))

s = input()
a,b = [int(x) for x in s.split()]
c,ans = 0,0;
while True:
    c = min(a,b)
    a = max(a,b)
    b = c
    ans += a // b
    a = a % b
    if a % b == 0:
        break;
print(ans)


count = 0
a, b = list(map(int, input().split(" ")))
while a > 0 and b > 0:
    count += a//b
    x = b
    b = a % b
    a = x
print(count)

s = input()
s = s.split()
a = int(s[0])
b = int(s[1])
count = 0
while a > 1 and b > 1:
	count += a // b
	a, b = (b , a % b)
if a != 0 and b != 0:
	count += a
print(count)

n, m = [int(x) for x in input().split()]
c, mn, mx = 0, 0, 0
while n != m and n > 0 and m > 0:
    p = max(n, m) // min(n , m)
    c += p
    if n > m:
        n -= p * m
    else:
        m -= p * n
print(c)



a,b=list(map(int,input().split()))
res=0
while a!=0 and b!=0:
    if a>=b:
        res+=a//b
        a=a%b
    elif b>a:
        res+=b//a
        b=b%a
print(res)