Statement
Statement language
jkrt wants to cover a board of length exactly with tiles.
Choose two distinct positive integers and , and place tiles of lengths and alternately. Both the first and the last tile must have length , and each of the two tile lengths must be used at least once.
Find the number of ordered pairs for which the board can be covered exactly without overlaps or extending beyond the board.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the number of valid ordered pairs on one line.
Constraints
- .
- .
Subtasks
Samples
Input
4
4
5
6
10
Output
1
2
1
5
For , the only valid ordered pair is . Tiles of lengths cover the board exactly.