#include<iostream>
#include<string>
#include <algorithm>
#include<iomanip>
#include<cmath>
using std::cin; using std::string;
using std::cout; using std::endl;
using std::sort;
#define rep(X,Y) for(int (X)=0;(X)<(Y);++(X))
#define rept(X,Y,Z) for(int (X)=(Y);(X)<(Z);++(X))
#define repr(X,Y) for(int (X)=(Y);(X)>=0;--(X))
const double pi=3.141592653589793283462;
int main(){
	int n;
	int i=0;
	while(1){
		cin>>n;
		if(n==0)
			break;
	while(1){
		if(n==1)
			break;
		if(n%2==0)
			n=n/2;
		else
			n=n*3+1;
		i++;
	}
	cout<<i<<endl;
	i=0;
	}
	return 0;
}      