s=int(eval(input()))

l=[s]

ans=[]

for i in range(10**5):

    if s%2==0:

        s=s/2

        l.append(s)

    else:

        s=s*3+1

        l.append(s)

        

for i in range(10**3):

    for j in range(i+1,10**3):

        if l[i]==l[j]:

            ans.append(j)

print((min(ans)+1))
def f(n):

    if n%2 == 0:

        return n//2

    else:

        return 3*n + 1



L = [int(eval(input()))]



for i in range(10**10):

    L.append(f(L[i]))



    if L[i+1] in L[:i]:

        print((i+2))

        break

s = int(eval(input()))
l = [s]
ans = []
for i in range(10**5):
    if s % 2 == 0:
        s = s / 2
        l.append(s)
    else:
        s = s * 3 + 1
        l.append(s)
for i in range(10**3):
    for j in range(i + 1, 10**3):
        if l[i] == l[j]:
            ans.append(j)
print((min(ans) + 1))

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


L = [int(eval(input()))]
for i in range(10**10):
    L.append(f(L[i]))
    if L[i + 1] in L[:i]:
        print((i + 2))
        break

-s = int(eval(input())) -l = [s] -ans = [] -for i in range(10**5): -    if s % 2 == 0: -        s = s / 2 -        l.append(s) +def f(n): +    if n % 2 == 0: +        return n // 2 -        s = s * 3 + 1 -        l.append(s) -for i in range(10**3): -    for j in range(i + 1, 10**3): -        if l[i] == l[j]: -            ans.append(j) -print((min(ans) + 1)) +        return 3 * n + 1 + + +L = [int(eval(input()))] +for i in range(10**10): +    L.append(f(L[i])) +    if L[i + 1] in L[:i]: +        print((i + 2)) +        break