#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define precise(i) fixed << setprecision(i) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; bool isPrime(int num) { if (num == 1 || num == 2) return true; else if (num % 2 == 0) return false; for (int i = 3; i * i <= num; i += 2) { if (num % i == 0) return false; } return true; } int main() { fastIO; int N; cin >> N; for (int i = N - 100; i < N + 100; ++i) { if (!isPrime(i)) { cout << i << '\n'; return 0; } } return 0; }