#include <cstdio>

int main() {
	int n;
	while (scanf("%d", &n)) {
		if (n == 0) break;
		long long int res = 0;
		long long int temp = n;
		while (1) {
			if (temp%2 == 0) {
				temp /= 2;
			} else {
				temp = temp * 3 + 1;
			}
			res++;
//			printf("%d\n", temp);
			if (temp == 1) break;
		}
		printf("%lld\n", res);
	}
}