log2

Time limit: 0.1s Memory limit: 3MB Input: Output:

You are given a strictly positive integer xx written in base 16.

Task

Calculate the floor of the base-2 logarithm of xx.
More formally, calculate log2(x)\lfloor log_{2}(x) \rfloor.

Input

A strictly positive integer xx written in base 16.

Output

The natural number log2(x)\lfloor log_{2}(x) \rfloor written in base 10.

Restrictions

  • xx has maximum 100 000100\ 000 digits in base 16;
  • xx can contain leading zeros;
  • The digits in base 16 are, in order, 0123456789ABCDEF.

Example 1

stdin

001

stdout

0

Example 2

stdin

4A

stdout

6

Explanation

In the first example, 001(16)\text{001}_{(16)} is 1(10)1_{(10)}, so log2(x)=0(10)\lfloor log_{2}(x) \rfloor = 0_{(10)}.
In the second example, 4A(16)\text{4A}_{(16)} is 74(10)74_{(10)}, so log2(x)=6(10)\lfloor log_{2}(x) \rfloor = 6_{(10)}.

Log in or sign up to be able to send submissions!