#include <iostream>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main() {
	int n, ans;

	while (scanf("%d", &n), n != 0) {
		ans = 0;
		while (n != 1) {
			if (n & 1) n = n * 3 + 1;
			else n /= 2;
			ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}