using System; class Program { static void Main() { long n = long.Parse(Console.ReadLine()); long ans = 0; for (long i = 3; i * i <= n; i++) { if (n % i == 0) { ans = i; break; } } if (ans == 0) ans = n; Console.WriteLine(ans); } }