eolymp
Problems

Egyptian symbols

Egyptian symbols

Last summer, the schoolboy Vasyl visited Egypt. Only now he remembered that during his visit, he had time to photograph many interesting things. Looking over these photos, most of all he was interested in views of the pyramids at Giza. The pyramids, apart from many characters, contained wonderful characters - 1, 2, 3, 4, 5, 6, 7, 8, 9, 0. Looking more attentively, Vasyl noticed that each row of strange characters is a power of two. The first line starts with a sequence of symbols 1, the second - 2, ..., one hundred and twentieth - 120, etc. Everything would be nice if Vasyl used a modern camera, but as his old one poorly photographed the most lit part of the pyramid, it was impossible to see all the characters and to determine the exponent of two, corresponding to these lines. Vasyl thought about the restoration of characters, and finally decided to ask someone to write a program (Vasyl studies at 6th form and did not know programming languages) that would define the exponent of two, which is written in the n-th row.

Input

One number n (n107).

Output

Print the minimum positive integer k such that two in degree k in decimal notation begins with number n. If Vasyl is wrong and such number does not exist, print -1.

Hint: Vasyl is small, but nothing has messed up, otherwise the ancient Egyptians would not scratch out these characters on their pyramids!

Time limit 1 second
Memory limit 128 MiB
Input example #1
12
Output example #1
7
Input example #2
134
Output example #2
27
Author Sobolev E., Sobolev D.