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(); scan.close(); 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=2; i < num; i++ ) { if (num%i == 0){ System.out.println(num); return true; } } return false; } }