#A0462. 游泳同步起步

游泳同步起步

Title Description

33DAI has been learning swimming recently.

  • 33DAI's swimming speed is very stable. Every time you depart from the starting point, you can return to the starting point within aa minutes.
  • Kitten's swimming speed is also very stable. Every time you depart from the starting point, you can return to the starting point within bb minutes.

They started together and swam for n minutes. How many times have they appeared at the starting point simultaneously.

Input format

A row of three integers a,b,na, b, n .

Output format

One integer per line represents the number of times two people appear at the starting point simultaneously.

3 4 15
two
4 6 33
three
6 8 48
three

Example explanation

-The 22 times that occur simultaneously at the starting point in Example 1 are: 00 time and 1212 time. -The 33 times that occur simultaneously at the starting point in Example 2 are: 00 time, 1212 time, and 2424 time. -The 33 times that occur simultaneously at the starting point in Example 3 are: 00 time, 2424 time, and 4848 time.

Data scale and agreement

For data of 100%100 \% , 1a,b1031 \le a, b \le 10^3 , 1n1041 \le n \le 10^4

-Subtask 1 (30 points): Ensure that a=1a=1 . -Subtask 2 (30 points): Ensure that bb is a multiple of aa . -Subtask 3 (40 points): No special restrictions.