import itertools def solve(n0): nmax = n0 n = n0 for i in itertools.count(1): if n % 2 == 0: n //= 2 else: n = 3 * n + 1 nmax = max(n, nmax) if n == 1: return i, nmax def main(): n0 = int(input()) imax, nmax = solve(n0) print(imax) print(nmax) if __name__ == "__main__": main()