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

