using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { long N = long.Parse(Console.ReadLine()); long min = N; for(int i = 2; i <= Math.Sqrt(N); i++) { if (N % i == 0) { if (i >= 3) { min = Math.Min(min, i); } if (N / i >= 3) { min = Math.Min(min, N / i); } } } Console.WriteLine(min); } }