The sum of p
(p > 0
) consecutive integers can often be equal to the sum of next q consecutive positive integers. For example:
9 + 10 + 11 + 12 = 13 + 14 + 15
, here p = 4
and q = 3
4 + 5 + 6 + 7 + 8 = 9 + 10 + 11
, here p = 5
and q = 3
.
Given the value of q
, how many possible values of p
are there?
Contains at most 1500 lines. Each line contains a positive integer less than 10^14
, which denotes the value of q
. Input is terminated by a line containing a single zero. This line should not be processed.
For each input line print one line that contains an integer, which denotes the total number of possible values of p
.