#include <iostream>
#include <sstream>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
int gcd(int m, int n)
{
while(n != 0)
{
int r = m % n;
m = n;
n = r;
}
return m;
}
int main()
{
int n;
while(scanf("%d",&n)&& n!=0)
{
int a=0;
while(n%2!=0)
{
n/=2;
a++;
}
printf("%d\n",a);
}
// cin>>n scanf("%d",&n)&
return 0;
}