Azeroth is a world full of fantasy. In Azeroth, there are

hours in a day and

minutes in an hour.
You found a clock made from Azeroth. The clock has two hands --- the hour hand and the minute hand. The two hands point to the same direction at the start of a day. Either hand rotates at a constant speed. The hour hand goes around a full circle in

hours and the minute hand goes around a full circle in

minutes. Surprisingly, it is night in Azeroth if and only if the angle between the two hands is less than or equal to

.
Now you're wondering, given

, how many integral moments (i.e., integer minutes since the start of the day) are there, such that the angle between the two hands is less than or equal to

.