N = int(input()) list =[N] while True: if N ==1: list.append(N) break elif N % 2 == 0: N = N/2 list.append(N) else: N = 3*N+1 list.append(N) print(list.index(1)) print(int(max(list)))