#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int MAXN = 1000 * 1000 + 10;

int d[MAXN] = {};

int solve(int n)
{
    if(n == 1) return 0;
    if(d[n] != 0) return d[n];

    if(n % 2)
        d[n]= 1 + solve( n * 3 + 1);
    
    else d[n] = 1 + solve(n / 2);

    return d[n];
}

int main()
{
    int n;
    while(cin >> n && n) 
    {
        cout << solve(n) << endl;
    }
    return 0;
}