def collatz(n):

	c = 0

	while n > 1:

		if n%2:	n = 3*n+1

		else: n /= 2

		c += 1

	return c

	

while True:

	n = int(input())

	if n == 0: break

	print(collatz(n))
def f(n):

	c=0

	while n>1:

		if n%2:n=3*n+1

		else:n /= 2

		c += 1

	print(c)

	

while 1:

	n=eval(input())

	if n==0:break

	f(n)
def collatz(n):
    c = 0
    while n > 1:
        if n % 2:
            n = 3 * n + 1
        else:
            n /= 2
        c += 1
    return c


while True:
    n = int(input())
    if n == 0:
        break
    print(collatz(n))

def f(n):
    c = 0
    while n > 1:
        if n % 2:
            n = 3 * n + 1
        else:
            n /= 2
        c += 1
    print(c)


while 1:
    n = eval(input())
    if n == 0:
        break
    f(n)

-def collatz(n): +def f(n): -    return c +    print(c) -while True: -    n = int(input()) +while 1: +    n = eval(input()) -    print(collatz(n)) +    f(n)