#include using namespace std; bool divisor(int x){ for(int i = 2;i < x;i++) if(!(x % i)) return true; return false; } int composite(int x){ for(int i = x - 100;i <= x + 100;i++) if(divisor(i)) return i; } int main(){ int n; cin >> n; cout << composite(n) << endl; }