Gym

No attempts yetTime limit1sMemory limit128 MB

Problem

Adrian decided that his chest was scrawny and his belly was round, so he made up his mind to bulk up his chest. He set himself the goal of bench pressing nn micrograms by the end of the year. Adrian works at two different breweries that make (non-alcoholic, of course) beer. One brewery makes beers weighing aa micrograms each, and the other makes beers weighing bb micrograms each.

Adrian decided to bench press stacks of beer. He starts from the lightest possible weight and moves up one step at a time, always going to the next heavier weight he can form. He wonders how many different weights he will lift by the time he reaches the heaviest one. He cannot mix beers from the two breweries in a single lift, but within a single brewery he has as many beers as he needs. In other words, a weight he can lift is any value that is a positive multiple of aa (stacking only the first brewery's beers) or a positive multiple of bb (stacking only the second brewery's beers) and does not exceed nn.

Input

The only line of input contains three integers aa, bb, and nn: respectively the weight of a beer from the first brewery, the weight of a beer from the second brewery, and Adrian's target weight, with 1a,bn1091 \le a, b \le n \le 10^9.

Output

Print a single integer on one line: the number of different weights Adrian will lift. That is, the number of positive integers not greater than nn that are a multiple of aa or a multiple of bb.

Hint

For a=5a = 5, b=7b = 7, n=15n = 15, Adrian lifts 5 (first brewery), 7 (second), 10 (first), 14 (second), and 15 (first). The distinct weights are 5, 7, 10, 14, and 15, five in total, so the answer is 5.