cheesecake is making origami and he needs your help! He has an arbitrarily large rectangular piece of paper that he needs to cut into pieces, whose dimensions don't matter.
cheesecake likes to be efficient. Therefore, if he can, he will stack multiple pieces of paper on top of one another and cut them all at the same time. Note that since he wants crisp origami, he will not fold any papers beforehand. For example, if he needs pieces of paper, he can cut the starting piece in , then stack the pieces together and cut them to obtain pieces. The catch is, cheesecake doesn’t have very good scissors, so he can cut through at most sheets of paper at a time.
To save time, he would like for you to find out the minimum number of cuts required to obtain the pieces.
Subtask 1 [60%]
Subtask 2 [40%]
The only line of input contains and , separated by a space.
One integer, the minimum number of cuts required to obtain the pieces.
Sample Input 1
Sample Output 1
Explanation for Sample Output 1
See problem description above.
Sample Input 2
Sample Output 2
Explanation for Sample Output 2
Since cheesecake's scissors can only cut through one piece of paper at a time, he has to cut the paper times for pieces of paper.
Sample Input 3
Sample Output 3