Start 2021-05-12 00:00:00

2012 年江苏省信息与未来夏令营

End 2022-06-05 00:00:00
Contest is over.
Now 2025-05-10 10:20:56

H. 堆木头

Description

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

Input

n 一个整数

Output

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

Examples

Input

21

Output

3

Hint


Submit

Login

Signup
Time Limit 2 seconds
Memory Limit 128 MB
Submit