using System; class Replace { static void Main(String[] args) { long N = long.Parse(Console.ReadLine()); long sqn = (long)Math.Sqrt(N) + 1; for(long i = 3; i <= sqn; i++) { if(N % i == 0) { Console.WriteLine(i); return; } } Console.WriteLine(N); } }