while 1:

  n = int(input())

  if n==0: break

  c=0

  while n!=1:

    n=[n/2,n*3+1][n%2]

    c+=1

  print(c)
while 1:

  n = eval(input())

  if n==0: break

  c=0

  while n>1:

    n = n*3+1 if n%2 else n/2

    c += 1

  print(c)
while 1:
    n = int(input())
    if n == 0:
        break
    c = 0
    while n != 1:
        n = [n / 2, n * 3 + 1][n % 2]
        c += 1
    print(c)

while 1:
    n = eval(input())
    if n == 0:
        break
    c = 0
    while n > 1:
        n = n * 3 + 1 if n % 2 else n / 2
        c += 1
    print(c)

-    n = int(input()) +    n = eval(input()) -    while n != 1: -        n = [n / 2, n * 3 + 1][n % 2] +    while n > 1: +        n = n * 3 + 1 if n % 2 else n / 2