def resolve():

	s=int(eval(input()))

	l=[s]

	while 1:

		if s%2==0:

			s//=2

		else:

			s=3*s+1

		if s in l:

			l.append(s)

			break

		l.append(s)

	print((len(l)))

resolve()
s=int(eval(input()))

t=[]

k=1

while s not in t:

	t+=[s]

	s=3*s+1 if s%2 else s//2

	k+=1

print(k)
def resolve():
    s = int(eval(input()))
    l = [s]
    while 1:
        if s % 2 == 0:
            s //= 2
        else:
            s = 3 * s + 1
        if s in l:
            l.append(s)
            break
        l.append(s)
    print((len(l)))


resolve()

s = int(eval(input()))
t = []
k = 1
while s not in t:
    t += [s]
    s = 3 * s + 1 if s % 2 else s // 2
    k += 1
print(k)

-def resolve(): -    s = int(eval(input())) -    l = [s] -    while 1: -        if s % 2 == 0: -            s //= 2 -        else: -            s = 3 * s + 1 -        if s in l: -            l.append(s) -            break -        l.append(s) -    print((len(l))) - - -resolve() +s = int(eval(input())) +t = [] +k = 1 +while s not in t: +    t += [s] +    s = 3 * s + 1 if s % 2 else s // 2 +    k += 1 +print(k)