#include <iostream>
using namespace std;

int main()
{
	int n;


	while(true){
		int c = 0;
		
		cin >> n;

		if(n==0)
			break;


		for(int i=0 ;n!=1 ;i++){
		
			if(n%2 == 0){
				n = n/2;
				c++;
			}
			else if(n%2 != 0){
				n = 3*n + 1;
				c++;

			}
		}

		cout << c << endl;
	}
	return 0;
}