#include <iostream>
#include <algorithm>
#include <vector>

#define ll long long
ll solve(ll n,ll k){
    if(n==1)return k;
    if(n%2==0)return solve(n/2,k+1);
    else return solve(3*n+1,k+1);
}
using namespace std;

int main(){
    ll n = 1;
    while(cin >> n && n != 0){
        cout << solve(n,0) << endl;
    }
    return 0;
}