a = int(eval(input()))

b = [a]

c = 1

while True:

    c += 1

    if a % 2 == 0:

        a = a // 2

    else:

        a = 3 * a + 1

    if a in b:

        print(c)

        exit()

    else:

        b.append(a)

a = int(eval(input()))

b = [a]

d = 1

while True:

    c = b[len(b)-1]

    d += 1

    if c % 2 == 0:

        c = c // 2

    else:

        c = c * 3 + 1

    if c not in b:

        b.append(c)

    else:

        print(d)

        exit()

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

a = int(eval(input()))
b = [a]
d = 1
while True:
    c = b[len(b) - 1]
    d += 1
    if c % 2 == 0:
        c = c // 2
    else:
        c = c * 3 + 1
    if c not in b:
        b.append(c)
    else:
        print(d)
        exit()

-c = 1 +d = 1 -    c += 1 -    if a % 2 == 0: -        a = a // 2 +    c = b[len(b) - 1] +    d += 1 +    if c % 2 == 0: +        c = c // 2 -        a = 3 * a + 1 -    if a in b: -        print(c) +        c = c * 3 + 1 +    if c not in b: +        b.append(c) +    else: +        print(d) -    else: -        b.append(a)