P10432 [AOJ] 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

输入格式

见题面

输出格式

见题面

样例输入
2
样例输出
1