Egyptian symbols#186

Egyptian symbols

1 second
128 megabytes
Very easy

Last summer, schoolboy Vasylko visited Egypt. Only now he remembered that during his trip, he managed to photograph many interesting things. While looking through these pictures, Vasylko became especially interested in the views of the pyramids at Giza. In addition to various hieroglyphs, the pyramids contained unusual symbols: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.

Upon closer examination, Vasylko noticed that each row of these mysterious symbols represents a power of two. Specifically, the first row starts with , the second with , ..., the one hundred twentieth with , and so on. If only Vasylko had used a modern camera, everything would be clear, but his old camera poorly captured the brightest parts of the pyramid, making not all symbols visible and therefore making it difficult to determine the corresponding exponent of two for each row.

Vasylko decided to restore the symbols and, in the end, wants someone to write a program (as he is in the 6th grade and does not know programming) that determines the exponent of two that appears in the -th row.

Input

The only input is the number (n \leq 10^7).

Output

Print the smallest positive integer such that the decimal representation of 2^k begins with . If Vasylko mixed something up and there is no such , print -1.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

Although Vasylko is still young, he did not make any mistakes; otherwise, the ancient Egyptians would not have carved such symbols on their pyramids!