m=int(input()) ans=m for i in range(100000): if m&1:m=m*3+1 else:m>>=1 ans=max(ans,m) if m==1: print(i+1) print(ans) break