#include <iostream>

int main() {
	int n;
	scanf("%d", &n);
	bool used[1000001] = { 0 };
	int res = 0;
	while (!used[n]) {
		used[n] = true;
		if (n%2) n = n * 3 + 1;
		else n /= 2;
		res++;
	}
	printf("%d\n", res + 1);
	return 0;
}
