using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder { public class IO { public static string ReadStr() => Console.ReadLine(); public static string[] ReadStrArr() => ReadStr().Split(' '); public static int ReadInt() => int.Parse(ReadStr()); public static int[] ReadIntArr() => Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse); public static double ReadDouble() => double.Parse(ReadStr()); public static double[] ReadDoubleArr() => Array.ConvertAll(Console.ReadLine().Split(' '), double.Parse); public static long ReadLong() => long.Parse(ReadStr()); public static long[] ReadLongArr() => Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse); } class Program { static void Main(string[] args) { int init = IO.ReadInt(); var data = new long[400]; data[0] = init; for (var i = 1; i < 400; i++) { data[i] = (data[i-1] % 2 == 0) ? data[i-1] / 2 : 3 * (data[i - 1]) + 1; } int indexOfOne = Array.IndexOf(data, 1); long max = long.MinValue; for (var i = 0; i <= indexOfOne; i++) { max = Math.Max(max, data[i]); } Console.WriteLine("{0}\n{1}",indexOfOne,max); return; } } }