You are playing a game with your friend. There is a pile with stones and a chosen number
. You and your friend alternate turns to remove some number of stones. Call
the number of stones removed on the
turn.
, that is, the first player must remove exactly
stone. After that, on the
turn, the current player is allowed to remove any number of stones between
and
. The player who removes the last stone wins. Given that you are the first player, for how many possible
between
and
inclusive can you guarantee a win?
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [40%]
Subtask 4 [40%]
Input Specification
The first line will have three space-separated integers, ,
, and
in that order.
Output Specification
Output the answer.
Sample Input
5 11 41
Sample Output
6
Comments