import java.util.Scanner;
public class a414 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int a = sc.nextInt();
int count=0;
if(a==0) {
break;
}else {
for(int i=0 ; a>0 && a%2==1 ;i++) {
a/=2;
count++;
}
System.out.println(count);
}
}
}
}