s=int(eval(input()))

i=2

while s>1:s=[s//2,s*3+1][s%2];i+=1

print((max(i,4)))
s=int(eval(input()))

i=4

while s>4or 3==s:s=[s//2,s*3+1][s%2];i+=1

print(i)
s = int(eval(input()))
i = 2
while s > 1:
    s = [s // 2, s * 3 + 1][s % 2]
    i += 1
print((max(i, 4)))

s = int(eval(input()))
i = 4
while s > 4 or 3 == s:
    s = [s // 2, s * 3 + 1][s % 2]
    i += 1
print(i)

-i = 2 -while s > 1: +i = 4 +while s > 4 or 3 == s: -print((max(i, 4))) +print(i)