#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
using namespace std;
int main(){

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