s = int(eval(input()))

MAX = 10**6

def f(n):

    if n%2==0:

        return n//2

    else:

        return 3*n + 1



l = [0] * MAX

l[s] = 1

for i in range(2,MAX+1):

    temp = f(s)

    if l[temp]==1:

        print(i)

        exit()

    l[temp] = 1

    s = temp

s = int(eval(input()))

MAX = 10**6

def f(n):

    if n%2==0:

        return n//2

    else:

        return 3*n + 1



l = []

l.append(s)

for i in range(2,MAX+1):

    temp = f(s)

    if temp in l:

        print(i)

        exit()

    l.append(temp)

    s = temp

s = int(eval(input()))
MAX = 10**6


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


l = [0] * MAX
l[s] = 1
for i in range(2, MAX + 1):
    temp = f(s)
    if l[temp] == 1:
        print(i)
        exit()
    l[temp] = 1
    s = temp

s = int(eval(input()))
MAX = 10**6


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


l = []
l.append(s)
for i in range(2, MAX + 1):
    temp = f(s)
    if temp in l:
        print(i)
        exit()
    l.append(temp)
    s = temp

-l = [0] * MAX -l[s] = 1 +l = [] +l.append(s) -    if l[temp] == 1: +    if temp in l: -    l[temp] = 1 +    l.append(temp)