Laser Beam
Time limit1sMemory limit1024 MB
Given mirror angle alpha and beam angle beta, count how many times a laser beam reflects off the two mirrors before it travels off to infinity.
Problem
Two infinite flat mirrors are placed at an angle to each other. Viewed from the side, they appear as two lines on a plane. A laser beam is fired through a tiny hole in one of the mirrors at an angle , as shown in the figure below.

Count the number of times the beam reflects off the mirrors before it travels off to infinity. The angle of incidence always equals the angle of reflection. The hole is extremely small, so if the beam happens to hit the hole, it still reflects according to the usual rules.
Input
Two integers and are given. Both are angles in degrees, with and .
Output
Print one integer, the number of reflections.
Hint
In the first example, the beam reflects as shown below.
