import math

def py():

    print("Yes")

def pn():

    print("No")

def iin():

    x = int(eval(input()))

    return x



neko = 0

nya = 0

nuko = 0



b = iin()

f = [0] * 1000001

i = 1

while True:

    if f[int(b)] == 0:

        f[int(b)] = i

    else:

        break

    b =  3 * b + 1 if b%2 else b/2

    i = i + 1

print(i)
def f(x):

    if x%2:

        return 3*x + 1

    else:

        return x/2

s = int(eval(input()))

a = [s]

for i in range(1,10**6+2):

    if f(a[i-1]) in a:

        print((i+1))

        break

    a.append(f(a[i-1]))

import math


def py():
    print("Yes")


def pn():
    print("No")


def iin():
    x = int(eval(input()))
    return x


neko = 0
nya = 0
nuko = 0
b = iin()
f = [0] * 1000001
i = 1
while True:
    if f[int(b)] == 0:
        f[int(b)] = i
    else:
        break
    b = 3 * b + 1 if b % 2 else b / 2
    i = i + 1
print(i)

def f(x):
    if x % 2:
        return 3 * x + 1
    else:
        return x / 2


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

-import math +def f(x): +    if x % 2: +        return 3 * x + 1 +    else: +        return x / 2 -def py(): -    print("Yes") - - -def pn(): -    print("No") - - -def iin(): -    x = int(eval(input())) -    return x - - -neko = 0 -nya = 0 -nuko = 0 -b = iin() -f = [0] * 1000001 -i = 1 -while True: -    if f[int(b)] == 0: -        f[int(b)] = i -    else: +s = int(eval(input())) +a = [s] +for i in range(1, 10**6 + 2): +    if f(a[i - 1]) in a: +        print((i + 1)) -    b = 3 * b + 1 if b % 2 else b / 2 -    i = i + 1 -print(i) +    a.append(f(a[i - 1]))