import java.util.Scanner; public class No312 { public static void main(String[] args) { Scanner s = new Scanner(System.in); long n = s.nextLong(); long i = 3; double sqrt = Math.sqrt(n); if (i > sqrt) { i = n; } else { while (i < sqrt) { if ((n % i) == 0) break; i++; } if (i == Math.ceil(sqrt)) i = n; } System.out.println(i); } }