n = int(input()) nmax = 0 for i in range(400): if n>nmax: nmax = n if n==1: print(i); break if n%2==0: n //= 2 else: n = n*3+1 print(nmax)