import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
int number = scanner.nextInt();
/**
*byte number=scanner.nextByte();
byte[] bytes = new byte[8];
for (int i = 0; i < 8; i++) {
bytes[bytes.length - i - 1] = (byte) (number & 1);
number = (byte) (number >> 1);
}
*/
String binaryString = Integer.toBinaryString(number); String[] strings = binaryString.split("0+"); //再将字符串按多个0分割 int count = 0; for (String string : strings) { count = Math.max(count, string.length()); } System.out.println(count); } }
}