#include<iostream>
#include<string>
#include<map>
using namespace std;
int main() {
	long long n;
	while (cin >> n&&n!=0) {
		int i = 0;
		while (n != 1) {
			if (n % 2 == 0) 
				n /= 2;
			else
				n = n * 3 + 1;
			i++;
		}
		cout << i << endl;
	}
}