N = int(input()) L = [N] while 1 not in L: N = [3*N+1, N//2][N % 2 == 0] L += [N] print(L.index(1)) print(max(L))