s=int(eval(input()))



if s==1 or s==2 or s==4:

  cnt=0

else:

  cnt=0

  while s!=4:

    if s%2==0:

      s=s/2

      cnt+=1

    else:

      s=3*s+1

      cnt+=1 



print((cnt+4))
s=int(eval(input()))

a=[s]



cnt=0

for i in range(10**6):

  if s%2==0:

    s=s/2

    cnt+=1

    if s in a:

      break

    a.append(s)

    

  else:

    s=3*s+1

    cnt+=1 

    if s in a:

      break    

    a.append(s)



print((cnt+1))
s = int(eval(input()))
if s == 1 or s == 2 or s == 4:
    cnt = 0
else:
    cnt = 0
    while s != 4:
        if s % 2 == 0:
            s = s / 2
            cnt += 1
        else:
            s = 3 * s + 1
            cnt += 1
print((cnt + 4))

s = int(eval(input()))
a = [s]
cnt = 0
for i in range(10**6):
    if s % 2 == 0:
        s = s / 2
        cnt += 1
        if s in a:
            break
        a.append(s)
    else:
        s = 3 * s + 1
        cnt += 1
        if s in a:
            break
        a.append(s)
print((cnt + 1))

-if s == 1 or s == 2 or s == 4: -    cnt = 0 -else: -    cnt = 0 -    while s != 4: -        if s % 2 == 0: -            s = s / 2 -            cnt += 1 -        else: -            s = 3 * s + 1 -            cnt += 1 -print((cnt + 4)) +a = [s] +cnt = 0 +for i in range(10**6): +    if s % 2 == 0: +        s = s / 2 +        cnt += 1 +        if s in a: +            break +        a.append(s) +    else: +        s = 3 * s + 1 +        cnt += 1 +        if s in a: +            break +        a.append(s) +print((cnt + 1))