import strutils let n0 = parseInt readLine stdin var n = n0 i = 0 m = 1 while n != 1: inc i m = max(n, m) if (n mod 2) == 0: n = n div 2 else: n = 3 * n + 1 echo i, "\n", m