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,n)){ break; } } } public static boolean check(int num,int n) { for(int i=1; i <= num; i++ ) { if (i <= 3){ continue; } if (i == n - 100 || i == n + 100){ System.out.println(num + 1); return true; } if (num%i == 0){ System.out.println(num); return true; } } return false; } }