#include<stdio.h>
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
    int a,b;
    int n=0;
    while(scanf("%d",&n)!=EOF)
    {
        int cnt=0;
        if(n==0)break;
        for(;;)
        {
            if(n%2==0)
            {
                //cout<<"ok"<<endl;
                n=n/2;
                cnt++;
            }
            else if(n%2!=0)
            {
                //cout<<"3ok"<<endl;
                n=n*3;
                n+=1;
                cnt++;
            }
            if(n==1)break;
        }
        cout<<cnt<<endl;
    }
    return 0;
}