-262. Maximum Number of Consecutive 1's

I'm a slow walker, but I never walk backwards.

題目來源:judgegirl from ntu prof. pangfeng Liu

Task Description

Write a program to compute the maximum number of consecutive 1's in their binary representation. For example 7 has three consecutive 1's since its binary representation is 00000111. 25 has two because its binary representation is 00011001.

Input

A set of positive integers no more than 2147483647, one per line. You must process them until EOF.

Output

The maximum number of consecutive 1's in the input, one per line.

Sample Input

1
126
25
7
65535
21
2147483647

Sample Output

1
6
2
3
16
1
31

Submit

Login

Testdata Set

Download Testdata