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