lst = [] S = int(input().strip()) lst.append(S) while True: if S % 2 == 0: S = S / 2 else: S = 3 * S + 1 if S in lst: break lst.append(S) print('{}\n{}\n'.format(len(lst) - 1, int(max(lst))))