using System; namespace No312 { class MainClass { public static void Main (string[] args) { long n = Convert.ToInt64 (Console.ReadLine ()); long a = n; if (n % 2 == 0) { a = n / 2; } for (long i = 3; i * i <= n; i++) { if (n % i == 0) { Console.WriteLine (i.ToString ()); return; } } Console.WriteLine (a.ToString ()); } } }