#include<iostream>
using namespace std;
int main() {
	int a,ans;
	while (1) {
		cin >> a;
		if (a == 0) {
			goto a;
		}
		ans = 0;
		while(a != 1) {
			ans++;
			if (a % 2 == 0) {
				a /= 2;
			}
			else {
				a = a * 3 + 1;
			}
		}
		cout << ans << endl;
	}
a:;
}
