ri = lambda: int(eval(input()))

rl = lambda: list(map(int,input().split()))



def f(n):

    if n%2 == 0:

        return n/2

    else:

        return 3*n+1



s = ri()



t = [0 for _ in range(1000000)]



ans = 0

a = s

for i in range(1,1000000):

    if t[int(a)] == 1:

        ans = i

        break

    else:

        t[int(a)] = 1

    a = f(a)



print(ans)
ri = lambda: int(eval(input()))

rl = lambda: list(map(int,input().split()))



def f(n):

    if n%2==0:

        return n//2

    else:

        return 3*n+1



s = ri()



used = set()

ans = 1

while True:

    if s in used:

        break

    used.add(s)

    ans += 1

    s = f(s)

print(ans)
ri = lambda: int(eval(input()))
rl = lambda: list(map(int, input().split()))


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


s = ri()
t = [0 for _ in range(1000000)]
ans = 0
a = s
for i in range(1, 1000000):
    if t[int(a)] == 1:
        ans = i
        break
    else:
        t[int(a)] = 1
    a = f(a)
print(ans)

ri = lambda: int(eval(input()))
rl = lambda: list(map(int, input().split()))


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


s = ri()
used = set()
ans = 1
while True:
    if s in used:
        break
    used.add(s)
    ans += 1
    s = f(s)
print(ans)

-        return n / 2 +        return n // 2 -t = [0 for _ in range(1000000)] -ans = 0 -a = s -for i in range(1, 1000000): -    if t[int(a)] == 1: -        ans = i +used = set() +ans = 1 +while True: +    if s in used: -    else: -        t[int(a)] = 1 -    a = f(a) +    used.add(s) +    ans += 1 +    s = f(s)