import java.util.*; public class Main { public static void main(String[] args) { int o,p,q; int a = 0, b = 0,c=0; Scanner sc = new Scanner(System.in); // int[] test = new int[100000]; // int[] test2 = new int[1000]; // String str1 = sc.next(); long t = Long.parseLong(sc.next()); for(long i= 3 ;t > i ; i++){ if(t%i==0){ System.out.println(i); break; } } // String str2 = sc.next(); /* int s = Integer.parseInt(sc.next()); int t = Integer.parseInt(sc.next()); int u = Integer.parseInt(sc.next()); */ /* int d = 0;     while(true){ int v = Integer.parseInt(sc.next()); test2[d] = v ; d++; } */ /* for(int i=0;i