e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

Summer School 2011 in Sevastopol, Day 3

Disc number

In all known classical problem of the Tower of Hanoi assume discs numbered consecutive numbers starting from zero so that the disk with a larger diameter corresponded to a greater number.

Our task - for a given serial number (numbered from 1) the correct solution to determine the serial number of the disk, which made this move.

We believe that the original number of drives is enough for the demanded number of moves.

Input

The only line of input contains the number n (1n263) we are interested in running.

Output

Print the serial number of the disk, which made n-th move.

Time limit 1 second
Memory limit 64 MiB
Input example #1
1
Output example #1
0
Input example #2
6
Output example #2
1