l = [] a = input() n = int(a) l.append(n) while True: if n % 2 == 0: n = n / 2 l.append(n) continue elif n % 2 == 1: if n != 1: n = 3 * n + 1 l.append(n) continue else: break i = index(1) nm = max(l) print(i) print(nm)