using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var n = long.Parse(Console.ReadLine()); var c = true; for(var i = 3; i <= (long)Math.Floor(Math.Sqrt(n)); i++) { if (n % i == 0) { Console.WriteLine(i); c = false; break; } } if (c) { if (n % 2 == 0&&n/2>2) { Console.WriteLine(n / 2); } else { Console.WriteLine(n); } } } } }