s = int(eval(input()))



exist_set = set()

index = 1



while s not in exist_set:

  exist_set.add(s)

  s = s//2 if s%2==0 else 3*s+1

  index += 1



print(index)
s = int(eval(input()))



def f(x):

  if x%2==0:

    return x//2

  else:

    return 3*x+1



a = set()

a.add(s)

index = 1

  

while True:

  index += 1

  s = f(s)

  if s not in a:

    a.add(s)

  else:

    break

    

print(index)
s = int(eval(input()))
exist_set = set()
index = 1
while s not in exist_set:
    exist_set.add(s)
    s = s // 2 if s % 2 == 0 else 3 * s + 1
    index += 1
print(index)

s = int(eval(input()))


def f(x):
    if x % 2 == 0:
        return x // 2
    else:
        return 3 * x + 1


a = set()
a.add(s)
index = 1
while True:
    index += 1
    s = f(s)
    if s not in a:
        a.add(s)
    else:
        break
print(index)

-exist_set = set() + + +def f(x): +    if x % 2 == 0: +        return x // 2 +    else: +        return 3 * x + 1 + + +a = set() +a.add(s) -while s not in exist_set: -    exist_set.add(s) -    s = s // 2 if s % 2 == 0 else 3 * s + 1 +while True: +    s = f(s) +    if s not in a: +        a.add(s) +    else: +        break