Consecutive Sums#3104

Consecutive Sums

10 secondi
128 megabyte
Difficile

The sum of (p > 0) consecutive integers can often be expressed as the sum of the next consecutive positive integers. For example:

Given the value of , find the number of possible values of .

Input

Contains at most lines. Each line contains a positive integer less than 10^{14}, which denotes the value of . Input is terminated by a line containing a single zero. This line should not be processed.

Output

For each input line, print one line containing an integer, which denotes the number of possible values of .

Esempi

Esempio 1

Loading
Loading