a = int(eval(input()))

als = [0]*(10**6+2)

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

    als[a] = 1

    if a%2 == 0:

        a = a//2

    else:

        a = 3*a+1

    if als[a] == 1:

        print((i+2))

        exit()

a = int(eval(input()))

als = [0]*(100000)

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

    als[a] = 1

    if a%2 == 0:

        a = a//2

    else:

        a = 3*a+1

    if als[a] == 1:

        print((i+2))

        exit()
a = int(eval(input()))
als = [0] * (10**6 + 2)
for i in range(0, 10**6 + 2):
    als[a] = 1
    if a % 2 == 0:
        a = a // 2
    else:
        a = 3 * a + 1
    if als[a] == 1:
        print((i + 2))
        exit()

a = int(eval(input()))
als = [0] * (100000)
for i in range(0, 10**6 + 2):
    als[a] = 1
    if a % 2 == 0:
        a = a // 2
    else:
        a = 3 * a + 1
    if als[a] == 1:
        print((i + 2))
        exit()

-als = [0] * (10**6 + 2) +als = [0] * (100000)