시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB55272457.143%

문제

The Infinity City is located on an infinite quarterplane. There is an infinite number of sky-scrapers in the city, there is one sky-scraper located at every point with integer coordinates.

One unfortunate day there was an earthquake in the city. There was a huge tectonic crack along the line Ax + By = C and all the sky-scrapers at positions satisfying the inequality Ax + By > C simply disappeared. The city has now become a Finity City with only a finite number of sky-scrapers. But exactly how many?

입력

The only line of input contains three space-separated positive integers A, B, C. They are bounded as follows: A, B ≤ 1 000 000 000, C ≤ min(A, B) × 1 000 000 000.

출력

Your program should output exactly one integer: the number of sky-scrapers in the Finity City.

예제 입력 1

3 4 13

예제 출력 1

12

출처

Camp > POI Training Camp > ONTAK 2010 7-3번