s = int(eval(input()))



def f(n):

    if n%2 == 0:

        return n // 2

    else:

        return 3*n + 1



a = []

for i in range(1, 1000001):

    if i == 1:

        a.append(s)

    else:

        n = a[i-2]

        a.append(f(n))



b = []

for i, num in enumerate(a):

    if num in b:

        print((i+1))

        break

    b.append(num)
s = int(eval(input()))



def f(n):

    if n%2 == 0:

        return n // 2

    else:

        return 3*n + 1



a = [s]

for i in range(1, 1000001):

    if a[i-1] in a[:i-1]:

        print(i)

        break

    else:

        a.append(f(a[i-1]))
s = int(eval(input()))


def f(n):
    if n % 2 == 0:
        return n // 2
    else:
        return 3 * n + 1


a = []
for i in range(1, 1000001):
    if i == 1:
        a.append(s)
    else:
        n = a[i - 2]
        a.append(f(n))
b = []
for i, num in enumerate(a):
    if num in b:
        print((i + 1))
        break
    b.append(num)

s = int(eval(input()))


def f(n):
    if n % 2 == 0:
        return n // 2
    else:
        return 3 * n + 1


a = [s]
for i in range(1, 1000001):
    if a[i - 1] in a[: i - 1]:
        print(i)
        break
    else:
        a.append(f(a[i - 1]))

-a = [] +a = [s] -    if i == 1: -        a.append(s) +    if a[i - 1] in a[: i - 1]: +        print(i) +        break -        n = a[i - 2] -        a.append(f(n)) -b = [] -for i, num in enumerate(a): -    if num in b: -        print((i + 1)) -        break -    b.append(num) +        a.append(f(a[i - 1]))