#include <bits/stdc++.h>
using namespace std;


int main(){
	long long n;
	while(cin >> n,n != 0){	
		int op = 0;
		while(n != 1){
			n = n % 2 == 0 ? n/2 : 3*n+1;
			op++;
		}
		cout << op << endl;
	}
	return 0;
}

