#include<iostream>
using namespace std;
int n;
main()
{
    while(cin>>n,n)
    {
        int c=0;
        while(n!=1)
        {
            n=n%2?n*3+1:n/2;
            c++;
        }
        cout<<c<<endl;
    }
}
