#include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int x, count;

    while(cin >> x, x){
        count = 0;
        while(x != 1){
            if(x % 2 == 0){
                x /= 2;
            }else{
                x = x * 3 + 1;
            }
            count++;
        }
        cout << count << endl;
    }
}