#include<iostream>
using namespace std;
int main()
{
int num;
int times;
while (true)
{
cin >> num;
if (num == 0)
{
return 0;
}
times = 0;
while (num != 1)
{
if (num%2==0)
{
num = num / 2;
}
else
{
num = (num * 3 + 1) / 2;
}
times++;
}
cout << times << endl;
}
return 0;
}