b=int(input()) a=[b] while not a==1: if b%2==0: b=b/2 else: b=3*b+1 a.append(int(b)) print(f"{len(a)-1}\n{max(a)}")