s = int(eval(input()))

s_ = s

x = [s]

counter = 0

#while s != 1:



for _ in range(1000000):

  if s%2 ==0:

    s = s/2

    x.append(s)

  else:

      s = 3*s+1

      x.append(s)

#  counter +=1



if s_ == 4 or s_ == 2 or s_ == 1:

  print((4))

else:

  print((x.index(4)+4))

#print(x)  
s = int(eval(input()))

s_ = s

counter = 0



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

  print((counter+4))

else:  

  while s!=4:

    if s%2 ==0:

      s = s//2

      counter +=1

    else:

      s = 3*s+1

      counter +=1

  else:

    print((counter+4))

    

s = int(eval(input()))
s_ = s
x = [s]
counter = 0
# while s != 1:
for _ in range(1000000):
    if s % 2 == 0:
        s = s / 2
        x.append(s)
    else:
        s = 3 * s + 1
        x.append(s)
#  counter +=1
if s_ == 4 or s_ == 2 or s_ == 1:
    print((4))
else:
    print((x.index(4) + 4))
# print(x)

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

-x = [s] -# while s != 1: -for _ in range(1000000): -    if s % 2 == 0: -        s = s / 2 -        x.append(s) +if s == 4 or s == 2 or s == 1: +    print((counter + 4)) +else: +    while s != 4: +        if s % 2 == 0: +            s = s // 2 +            counter += 1 +        else: +            s = 3 * s + 1 +            counter += 1 -        s = 3 * s + 1 -        x.append(s) -#  counter +=1 -if s_ == 4 or s_ == 2 or s_ == 1: -    print((4)) -else: -    print((x.index(4) + 4)) -# print(x) +        print((counter + 4))