20120108 - 堆木头

有n根木头(2<=n<=10^20),堆成k层(2≤k≤n),要求下层木头数为上层木头数加1. 例如:

Input

n 一个整数

Output

一个整数 即堆法数,若不可能,则输出0.

Examples

Input

21

Output

3

Hint

Time Limit 2 seconds
Memory Limit 128 MB
Discuss Stats
上一题 下一题