using System; using System.Linq; using System.Collections.Generic; class No3 { static void Main() { var N = Int32.Parse(Console.ReadLine()); var array = new int[N]; for (int i = 0; i < N; ++i) array[i] = -1; array[0] = 1; var list = new Queue(); list.Enqueue(0); while (list.Count>0) { var u = list.Dequeue(); array[u] = array[u]+1; for (int i=0;i(); while (num != 0 && num != 1) { if (num % 2 == 1) list.Add(1); else list.Add(0); num /= 2; } list.Add(num); return list.Sum(); } }