#include <iostream>
#include <vector>
#define LIM 3000010

using namespace std;

int step[LIM]={0};

int rec(int n){
	
	if(n==1)
		return 0;
	else if(step[n] != 0)
		return step[n];
	
	if(n%2)//odd
		return step[n] = rec(n*3+1)+1;
	else//even
		return step[n] = rec(n/2)+1;
}

int main(){

	int n;
	
	while(cin>>n, n){
		cout << rec(n) << endl;
	}
	
	return 0;
}