import itertools

import math

import fractions

import functools

import copy

s = int(eval(input()))

a = set()

index = 0

a.add(s)

for i in range(1,1000000):

    if s % 2 == 0:

        s = s / 2

    else:

        s = 3*s + 1

    if s in a:

        index = i

        break

    a.add(s)

    

print((index+1))
def main():

    s = int(eval(input()))

    # a, b, c = map(int, input().split())

    # h = list(map(int, input().split()))

    # s = input()



    amount = [s]

    i = 1

    while True:

        if s % 2 == 0:

            s = s // 2

        else:

            s = 3*s + 1

        i += 1

        if s in amount:

            print(i)

            break

        amount.append(s)





if __name__ == '__main__':

    main()

import itertools
import math
import fractions
import functools
import copy

s = int(eval(input()))
a = set()
index = 0
a.add(s)
for i in range(1, 1000000):
    if s % 2 == 0:
        s = s / 2
    else:
        s = 3 * s + 1
    if s in a:
        index = i
        break
    a.add(s)
print((index + 1))

def main():
    s = int(eval(input()))
    # a, b, c = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()
    amount = [s]
    i = 1
    while True:
        if s % 2 == 0:
            s = s // 2
        else:
            s = 3 * s + 1
        i += 1
        if s in amount:
            print(i)
            break
        amount.append(s)


if __name__ == "__main__":
    main()

-import itertools -import math -import fractions -import functools -import copy +def main(): +    s = int(eval(input())) +    # a, b, c = map(int, input().split()) +    # h = list(map(int, input().split())) +    # s = input() +    amount = [s] +    i = 1 +    while True: +        if s % 2 == 0: +            s = s // 2 +        else: +            s = 3 * s + 1 +        i += 1 +        if s in amount: +            print(i) +            break +        amount.append(s) -s = int(eval(input())) -a = set() -index = 0 -a.add(s) -for i in range(1, 1000000): -    if s % 2 == 0: -        s = s / 2 -    else: -        s = 3 * s + 1 -    if s in a: -        index = i -        break -    a.add(s) -print((index + 1)) + +if __name__ == "__main__": +    main()