Module: GCD (Greatest Common Divisor)


Problem

7 /10


squares

Problem

At the labor lesson, everyone was given a rectangle with sides measuring A and B (whole, \( 1 <= A, B <= 2^{31} - 1\)). The boy Senya is very fond of cutting rectangles with special cynicism, and when the teacher invites everyone to cut out squares from a rectangle, Senya acts very cunningly. With one cut parallel to the side of the rectangle, he cuts off from the rectangle a square with a side equal to the smallest side of the rectangle and continues to do the same procedure with the part remaining after the cut. If a part turns out to be a square, then Senya calms down and begins to count the resulting squares.
How many squares will he cut?

Input
The numbers A and B are specified on the same line separated by a space.

Imprint
The number of resulting squares.
 

Examples
# Input Output
1 1 2 2