package yukicoder; import java.util.Scanner; public class Yuki12 { public static void main( String[] args ) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); for ( int i = (n - 100); i < n + 100; i++ ) { if(i<=3){ continue; } if(check(i)){ break; } } } public static boolean check(int num) { for(int i=1; i <= num; i++ ) { if(i<=3){ continue; } if(num%i == 0){ System.out.println(i); return true; } } return false; } }