N = int(input()) result = [N] while N > 1: if N % 2: N = 3 * N + 1 else: N = N // 2 result.append(N) print(len(result) - 1) print(max(result))