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 = n; for (int i = 1; i <= y; i++) { int p = i * (i + 1) / 2; if (p == n) { Console.WriteLine(1); return; } li.Add(i * (i + 1) / 2); if (li.Count(x => x + p == n) > 0) { Console.WriteLine(2); return; } } Console.WriteLine(3); } } }