Earthquake

No attempts yetTime limit1sMemory limit128 MB

Problem

Infinity City occupies an infinite quarter-plane: at every point (x,y)(x, y) with integer coordinates x0x \ge 0 and y0y \ge 0 there stands exactly one skyscraper, so the city contains infinitely many of them.

One day an earthquake tore a long crack along the line Ax+By=CAx + By = C. Every skyscraper standing at a point with Ax+By>CAx + By > C collapsed and vanished, leaving only the skyscrapers with Ax+ByCAx + By \le C. The city has become finite. Count how many skyscrapers remain.

Input

A single line contains three space-separated positive integers AA, BB, and CC, where 1A,B1091 \le A, B \le 10^9 and 1Cmin(A,B)×1091 \le C \le \min(A, B) \times 10^9.

Output

Print a single integer: the number of skyscrapers that remain in the city.