#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
	int x;
	while(1){
		int count = 0;
		cin>>x;
		if(x == 0) break;
		while(x != 1){
			if(x%2==0) x /= 2;
			else	   x = 3*x+1;
			count++;
		}
		cout<<count<<endl;
	}

	return 0;
}