#include <iostream>
using namespace std;

int main()
{
	int n;

	while(true){
		
		int count = 0;

		cin >> n;

		if(n==0)
			break;

		for(int i=0 ;n!=1 ;i++){

			if(n%2 == 0){
				n = n / 2;
	
				count++;
			}
			else if(n%2 != 0){
				n = n * 3 + 1;
			
				count++;
			}
		}

		cout << count << endl;

	}
	return 0;
}