n = int(input()) l = [n] while n != 1: if n % 2 == 0: n = n / 2 l.append(int(n)) elif n % 2 == 1: if n != 1: n = 3 * n + 1 l.append(int(n)) print(len(l)-1) print(max(l))