n = int(eval(input()))

c = 1

x = []

x.append(n)

while True:

    if n%2 == 0:

        n = n//2

    else:

        n = 3*n+1

    c+=1

    if n in x:

        break

    x.append(n)

print(c)
n = int(eval(input()))

c = 0

x = []

while True:

    c+=1

    if n in x:

        print(c)

        break

    x.append(n)

    if n%2 == 0:

        n = n//2

    else:

        n = 3*n+1
n = int(eval(input()))
c = 1
x = []
x.append(n)
while True:
    if n % 2 == 0:
        n = n // 2
    else:
        n = 3 * n + 1
    c += 1
    if n in x:
        break
    x.append(n)
print(c)

n = int(eval(input()))
c = 0
x = []
while True:
    c += 1
    if n in x:
        print(c)
        break
    x.append(n)
    if n % 2 == 0:
        n = n // 2
    else:
        n = 3 * n + 1

-c = 1 +c = 0 -x.append(n) +    c += 1 +    if n in x: +        print(c) +        break +    x.append(n) -    c += 1 -    if n in x: -        break -    x.append(n) -print(c)