p02125 OOllOll
Problem

Let $ f (x) $ be the sum of each digit when the non-negative integer $ x $ is expressed in binary.
Given a positive integer $ N $, output the largest of $ f (0) $, $ f (1) $, ..., $ f (N) $.


Example of calculating the function $ f (5) $:
When 5 is expressed in binary, it is 101 and the sum of each digit is 1 + 0 + 1 = 2
Therefore, $ f (5) = 2 $.


Note: https://ja.wikipedia.org/wiki/ Binary

Ouput

Outputs the largest of $ f (0) $, $ f (1) $, ..., $ f (N) $ on one line.

Constraints

The input satisfies the following conditions.

* $ 1 \ le N \ le 10 ^ 9 $

Input

The input is given in the following format.


$ N $


A positive integer $ N $ is given on one line.

Examples

Input

2


Output

1


Input

9


Output

3
```python
n = int(input())
ans = 0
tmp = 1
while tmp <= n+1 :
    tmp *= 2
    ans += 1
print(ans-1)

```