#D13055. OOllOll

    ID: 10856 Type: Default 1000ms 268MiB

OOllOll

OOllOll

Problem

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

Example of calculating the function f(5) 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 f (5) = 2 .

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

Ouput

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

Constraints

The input satisfies the following conditions.

  • 1 leN le109 1 \ le N \ le 10 ^ 9

Input

The input is given in the following format.

N N

A positive integer N N is given on one line.

Examples

Input

2

Output

1

Input

9

Output

3

inputFormat

outputFormat

output the largest of f(0) f (0) , f(1) f (1) , ..., f(N) f (N) .

Example of calculating the function f(5) 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 f (5) = 2 .

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

Ouput

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

Constraints

The input satisfies the following conditions.

  • 1 leN le109 1 \ le N \ le 10 ^ 9

Input

The input is given in the following format.

N N

A positive integer N N is given on one line.

Examples

Input

2

Output

1

Input

9

Output

3

样例

2
1