#include <cstdio>

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