def func1(N):

    if N%2==0:

        return N//2

    else:

        return 3*N+1

s = int(eval(input()))

a_n = {}

for i in range(1, 1000001):

    if s in a_n:

        break

    else:

        a_n[s] = 1

    s = func1(s)

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

a_list = [s]

i = 0

ans = -1

while (ans==-1):

    if a_list[i]%2==0:

        a_list.append(a_list[i]//2)

    else:

        a_list.append(3*a_list[i]+1)

    i += 1

    for j in range(len(a_list)-1):

        if a_list[i]==a_list[j]:

            ans = i

            break

print((ans+1))
def func1(N):
    if N % 2 == 0:
        return N // 2
    else:
        return 3 * N + 1


s = int(eval(input()))
a_n = {}
for i in range(1, 1000001):
    if s in a_n:
        break
    else:
        a_n[s] = 1
    s = func1(s)
print(i)

s = int(eval(input()))
a_list = [s]
i = 0
ans = -1
while ans == -1:
    if a_list[i] % 2 == 0:
        a_list.append(a_list[i] // 2)
    else:
        a_list.append(3 * a_list[i] + 1)
    i += 1
    for j in range(len(a_list) - 1):
        if a_list[i] == a_list[j]:
            ans = i
            break
print((ans + 1))

-def func1(N): -    if N % 2 == 0: -        return N // 2 +s = int(eval(input())) +a_list = [s] +i = 0 +ans = -1 +while ans == -1: +    if a_list[i] % 2 == 0: +        a_list.append(a_list[i] // 2) -        return 3 * N + 1 - - -s = int(eval(input())) -a_n = {} -for i in range(1, 1000001): -    if s in a_n: -        break -    else: -        a_n[s] = 1 -    s = func1(s) -print(i) +        a_list.append(3 * a_list[i] + 1) +    i += 1 +    for j in range(len(a_list) - 1): +        if a_list[i] == a_list[j]: +            ans = i +            break +print((ans + 1))