Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

K. Skills in Pills
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

An unnamed protagonist of this task received amazing e-mail offers for wondrous pills that will enhance their cognitive and all other sorts of abilities. After carefully analysing all offers and side effects, he has decided that he will order 2 types of pills, let's call them $$$A$$$ and $$$B$$$. He needs to take pill $$$A$$$ every $$$k$$$ days and pill $$$B$$$ every $$$j$$$ days. He will follow this meticulously over the next $$$n$$$ days.

More formally, in the next $$$n$$$ days, there should be no $$$k$$$ consecutive days where he does not take pill $$$A$$$ and no $$$j$$$ consecutive days where pill $$$B$$$ is not taken. However, there is a twist - the two pills are highly potent and must not be taken on the same day, lest horrible side effects should happen. Given this constraint, what is the smallest number of pills that he needs to take to meet these requirements?

Input

You are given three space-separated integers, $$$k, j$$$, and $$$n$$$.

Output

Print one number - the minimum number of pills that need to be taken. It is easy to prove that a solution always exists for the given constraints.

Examples
Input
2 3 8
Output
6
Input
2 3 11
Output
9
Input
3 7 100
Output
48
Note

In the first case, we can take pill A on days $$$2, 4, 5$$$, and $$$7$$$, and pill $$$B$$$ on days $$$3$$$ and $$$6$$$, giving the sequence $$$\texttt{.ABAABA.}$$$ In the second case, the best approach is to take pills in sequence $$$\texttt{.ABAABAABA}$$$. which requires taking $$$9$$$ pills.