def fun(n):

    if n%2:return 3*n+1

    return n//2

a=[0]+[int(eval(input()))]

i=1

while not fun(a[i]) in a:a.append(fun(a[i]));i+=1

print((i+1))
s=int(eval(input()))

i=2

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

print((max(i,4)))
def fun(n):
    if n % 2:
        return 3 * n + 1
    return n // 2


a = [0] + [int(eval(input()))]
i = 1
while not fun(a[i]) in a:
    a.append(fun(a[i]))
    i += 1
print((i + 1))

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

-def fun(n): -    if n % 2: -        return 3 * n + 1 -    return n // 2 - - -a = [0] + [int(eval(input()))] -i = 1 -while not fun(a[i]) in a: -    a.append(fun(a[i])) +s = int(eval(input())) +i = 2 +while ~-s: +    s = [s // 2, s * 3 + 1][s % 2] -print((i + 1)) +print((max(i, 4)))