#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(false); cin.tie(0);
int a;
while (cin >> a && a != 0)
{
int count;
for (count = 0; a%2 == 1; count++)
{
a = a / 2;
}
cout << count << "\n";
}
}