#include<bits/stdc++.h>
using namespace std;
void serch(int n,int now)
{
    if(n==1)cout<<now<<endl;
    else if(n%2==0)serch(n/2,now+1);
    else serch(n*3+1,now+1);
}
int main()
{
    int n;
    while(cin>>n,n)serch(n,0);
}