#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	while(1){
        int n;
        cin >> n;
        if(n == 0) break;
        int cnt = 0;
        while(1){
            if(n == 1) break;
            if(n % 2 == 0){
                n /= 2;
                cnt++;
            }
            else{
                n = n * 3 + 1;
                cnt++;
            }
        }
        cout << cnt << endl;
	}
	return 0;
}