#include <iostream>

int main()
{
	int n;
	while (true) {
		std::cin >> n;
		if (n==0) break;
		int count = 0;
		while (n>1) {
			if ((n&1)==1) n = 3*n+1;
			else n /= 2;
			count++;
		}
		std::cout << count << std::endl;
	}
	return 0;
}

