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; } } if(N % 2 ==1) Console.WriteLine(N); else Console.WriteLine(N/2); } }