using static System.Math; using System; public class Hello { static void Main() { var n0 = int.Parse(Console.ReadLine().Trim()); getAns(n0); } static void getAns (int n0) { var p = 0; var nmax = n0; var i1 = 1000; while ( p++ < 400) { if (n0 % 2 == 0) { n0 /= 2; if (n0 == 1) i1 = Min(i1, p); } else { n0 = 3 * n0 + 1; nmax = Max(nmax, n0); } } Console.WriteLine(i1); Console.WriteLine(nmax); } }