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) { if (n % 2 == 0) ans = n / 2; else ans = n; } Console.WriteLine(ans); } }