using System; using System.Collections.Generic; namespace y { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); var li = new List(); for (int i = 1; i <= n / 2; i++) { int p = i * (i + 1) / 2; if (p == n) { Console.WriteLine(1); return; } int e = i * (i + 1) / 2; li.Add(e); for (int j = li.Count - 1; j >= 0; j--) { if (li[j] < e / 2) { continue; } if (li[j] + e == n) { Console.WriteLine(2); return; } } } Console.WriteLine(3); } } }