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