#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;

int solve(ll n){
    int res = 0;
    while (n != 1){
        if (n & 1) n = n * 3 + 1;
        else n >>= 1;
        res++;
    }
    return res;
}

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