A strictly positive integer is polite if it can be written as the sum of two or more consecutive strictly positive integers. 7 is an example of a polite number as it can be written as 3+4. Polite numbers are sometimes also called staircase numbers because the Young diagrams, graphically representing the partitions of a polite number into consecutive integers, resemble staircases.

young diagram
A Young diagram visually representing the polite expansion 15 = 4 + 5 + 6.

Some numbers can be written as a sum of consecutive numbers in multiple ways. 15, for example, can be written in three different ways: 

1 + 2 + 3 + 4 + 5
4 + 5 + 6
7 + 8

The amount of ways in which a number can be written as a sum of two or more strictly positive integers, is called the politeness of a number. Numbers that are a power of two can't be written as a sum of two or more consecutive numbers. Those numbers have a politeness of 0, therefore they are impolite.

Input

A number $$n \in \mathbb{N}_0$$.

Output

A number that represents the politeness of the number $$n$$.

Example

Input:

15

Output:

3