At the moment, Barysh is watching channel on TV but wants to switch to channel b~(b > a) because an interesting football match is showing there. The TV remote is broken, only two buttons work. When one of these buttons is pressed, the TV switches to a channel with a number unit higher, and when the other button is pressed, the TV switches to a channel with a number units higher. Barysh wants to quickly switch to channel , pressing the minimum number of buttons, but there's a problem with channels whose numbers are exactly divisible by . When Barysh switches the TV to such a channel, the TV breaks.
What is the minimum number of button presses for Barysh to switch from channel number to channel number ?
The first line contains an integer , the second line contains an integer b~(1 \le a < b \le 10^9), and the third line contains an integer c~(2 \le c \le 10^9). It is guaranteed that and are not divisible by .
Print the minimum number of button presses for Barysh to switch from channel number to channel number .
In the first example, the transitions can be performed as follows: 2 → 4 → 5 → 7.
In the second example, the transitions can be performed as follows: 4 → 5 → 7 → 8 → 10.
Example 1
Example 2
This problem consists of subtasks. Points for a subtask are awarded only if all the tests associated with that subtask are passed successfully.
( points): b, c \le 15;
( points): b, c \le 10^5;
( points): c = 2;
( points): no additional constraints;