Two machines emit maintenance pings: machine A pings on every multiple of a, machine B on every multiple of b. A minute is a "busy minute" if at least one machine pings that minute. Considering the busy minutes in increasing order, find the n-th busy minute.
Equivalently, find the n-th smallest positive integer divisible by a or by b.
Input format
A single line with three integers a, b, and n.
Output format
A single integer: the n-th smallest positive integer divisible by a or by b.
Constraints
- 1 <= a <= 1000000
- 1 <= b <= 1000000
- 1 <= n <= 100000