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