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 n 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 a micrograms each, and the other makes beers weighing b 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 a (stacking only the first brewery's beers) or a positive multiple of b (stacking only the second brewery's beers) and does not exceed n.
The only line of input contains three integers a, b, and n: 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 1≤a,b≤n≤109.
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 n that are a multiple of a or a multiple of b.
For a=5, b=7, n=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.