include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int isSushu(int n){
if(n==1) return 0;
for(int i=2;i<=sqrt(n);i++){
if(n%i==0) return 0;
}
return 1;
}
int main(){
int n;
cin>>n;
if(isSushu(n)) cout<<n<<endl;
else{
for(int i=n;i<=20000;i++){
if(isSushu(i)){
cout<<i<<endl;
break;
}
}
}
return 0;
}