#include<iostream>

using namespace std;

int main(void){
	std::ios_base::sync_with_stdio();

	int n;
	int cnt;

	while(1){
		cin>>n;
		if(n==0) break;
		cnt=0;
		while(1){
			if(n==1) break;
			if(n%2==0) n/=2;
			else n=n*3+1;
			cnt++;
		}
		cout<<cnt<<endl;
	}

	return 0;
}