#include <iostream>
#include <algorithm>
using namespace std;

int count(int n);

int main(void){
	while (true){
		int n; cin >> n;
		if (!n){
			break;
		}
		cout << count(n) << endl;
	}
	return 0;
}

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