stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace std;

using namespace __gnu_pbds;



#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)

typedef long long int lli;

typedef pair<int, int> pi;

#define oset tree<int, null_type,greater<int>, rb_tree_tag,tree_order_statistics_node_update>



bool isprime(int n)

{

    bool fl = false;

    for(int i=2; i*i<=n; i++){

        if(n%i == 0){

            fl = true;

            break;

        }

    }

    return fl;

}



int main()

{

    int n;

    cin >> n;

    while(isprime(n)){

        n++;

    }

    cout << n;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.672762023289603x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

    int t,i,p=0,j,ans;

    cin>>t;

    if(t==2){

        cout<<"2"<<endl;

    }

    else{

    i=t;

    while(1){

            for(j=2;j<i;j++){

        if(i%j==0){

            p++;

        }}

    if(p==0){

            ans=i;

            goto e;

    }

    p=0;

i++;}



e:

    cout<<ans<<endl;}

}


// Faster C++ solution for the same problem (measured speedup: 5.0609403071330625x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int x;

    scanf("%d",&x);

    for(int i=2;i<x/2;i++)

    {

        if(x%i==0)

        {

            x++;

            i=1;

            continue;

        }



    }

    printf("%d",x);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.647539814103231x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include <iostream>

using namespace std;

bool isPrime(int num);



int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	int x;

	cin>>x;

	bool a=true, b;

	while(a)

	{

		b=isPrime(x);

		if(!b)	x++;

		else

		{

			cout<<x;

			a=false;

		}

	}

}

bool isPrime(int num)

{

	bool flag = true;

	for (int i = 2; i <= num / 2; i++)

	{

		if (num % i == 0)

		{

			flag = false;

			break;

		}

	}

	return flag;

}


// Faster C++ solution for the same problem (measured speedup: 4.761188106417676x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include<iostream>

#include<bits/stdc++.h>

using namespace std;



bitset<100010> prime;

const int ub = 100003;



void sieve()

{

    prime.set();

    prime[0] = prime[1] = 0;



    for(int I = 4; I<=ub; I+=2)

    {

        prime[I] = 0;

    }



    for(int I = 3; I*I<=ub; I+=2)

    {

        if(prime[I])

        {

            for(int J = I*I; J<=ub; J+=I)

            {

                prime[J] = 0;

            }

        }

    }



}



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    sieve();

    int N;

    cin>>N;

    while(!prime[N])N++;

    cout<<N<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 6.349796099429895x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int xx;

bool is_prime(ll x){

if(x<=1) return 0;

for(int i=2;i*i<=x;i++){

    if(x%i==0)return 0;

}

return 1;

}

int main(){

ll x;

cin>>x;

while(true){

    if(is_prime(x)){

        cout<< x << "\n";

        return 0;

    }

    x++;

}

return 0;



}




// Faster C++ solution for the same problem (measured speedup: 4.680623734848865x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
/* Ahmed Maher ( Acro_14 ) */

#include <bits/stdc++.h>

typedef long long ll;

const ll oo = 0x3f3f3f3f;

int const N = 1e5+5;

using namespace std;

//string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

//string BN(ll x){bool f=0;string Bn;int i=62;while(i--){if ((ll)x & (1LL << i)){Bn+='1';f=1;}else{if(f)Bn+='0';}}return Bn;}//Decimal to Binary converter

 int n = N;

int ans[664580];

int *Seive(){

    vector<bool> good(n);

    for(int i = 1; i < n; i++){

        good[i] = true;

    }

    good[1] = false;

    for(ll i = 2; i < n; i++){

        if(good[i]){

            // i = 1e7

            for(ll j = 1LL * i * i; j < n; j += i){

                good[j] = false;

            }

        }

    }

    int j=0;

    for(int i = 1; i < n; i++){

        if(good[i]){

           ans[j]=i;

           j++;

        }

    }

    return ans;

/*to print */

//    int *p;

//    p=Seive();

//      for(int i=0;i<10e7;i++){

//      cout << *(p + i) << endl;

//      system("pause");

//   }

/*end of print*/

}



int main()

{

    int *p,arr[N];

    p=Seive();

    for(int i=0;i<N;i++)arr[i] = *(p + i);

    int x;

    cin>>x;

        for (int i=0;i<N;i++){

            if (arr[i]>x && arr[i-1]<x){cout<<arr[i]<<endl;break;}

            else if (arr[i]==x){cout<<x<<endl;break;}

        }

}



//       int anss[t+1];

//            anss[j]=ans;

//     for(int j=1;j<=t;j++) printf("Case %d: %d\n",j,anss[j]);


// Faster C++ solution for the same problem (measured speedup: 12.688201384682015x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



bool prime(int x)

{

	if(x==2) return true;

	if(x<2 || x%2==0)

	return false;

	int root=sqrt(x);

	for(int i=3;i<=root;i+=2)

	{

		if(x%i==0)

		return false;

	}

	return true;

}

int main()

{

     int x;

     cin>>x;

     while(1)

     {

        bool res = prime(x);

     	if(res)

     	{

     		cout<<x;

     		return 0;

		}

		x++;

	 }   

}

// Faster C++ solution for the same problem (measured speedup: 4.669844572786958x):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)

typedef long long ll;





int main(){

    int x;

    cin >> x;

    int n = 200000;

    vector<int> seive(200001);

    for(int i=2; i*i<=n; i++){

        int cnt = 2;

        while(i*cnt <= n){

            seive[i*cnt]++;

            cnt++;

        }

    }

    vector<int> prime;

    for(int i=2; i<n; i++){

        if(seive[i]==0) prime.push_back(i);

    }

    auto itr = lower_bound(prime.begin(),prime.end(),x);

    cout << *itr << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.6214557505504372x):
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)

typedef long long ll;





int main(){

    int x;

    cin >> x;

    int n = 100300;

    vector<int> seive(100301);

    for(int i=2; i*i<=n; i++){

        int cnt = 2;

        while(i*cnt <= n){

            seive[i*cnt]++;

            cnt++;

        }

    }

    vector<int> prime;

    for(int i=2; i<n; i++){

        if(seive[i]==0) prime.push_back(i);

    }

    auto itr = lower_bound(prime.begin(),prime.end(),x);

    cout << *itr << endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.2895515910980055x):
#include <bits/stdc++.h>

using namespace std;



#define TC int n;scanf("%d",&n);while(n--)

#define lld long long int



int main()

{

    int n=0,i=0;

    cin>>n;

    int k=sqrt(n);

    for(i=2;i<=k;i++)

    {

        if(n%i==0)

        {

            ++n;

            k=sqrt(n);

            i=1;

        }

    }

    cout<<n;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.248595418671122x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int i,x,n;

    cin>>n;

    while(1)

    {

        x=0;

        for(i=2;i<=n;i++)

        {



            if(n%i==0)

            {

                break;

            }

            //c++;

        }

        if(i==n)

        {

            cout<<n;

            break;

        }

        n++;

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.280193880242899x):
#include<bits/stdc++.h>

using namespace std;



int main()

{

    long long n;

    cin>>n;

    int i,j=n,c=0;

    while(1)

    {



        for(i=2; i<=sqrt(j); i++)

        {

            if(j%i==0)

            {

                c=1;

                break;

            }

        }

        if(c==1)

        {

            j++;

            c=0;

            //cout<<"not prime\n";

        }

        else

        {

            cout<<j<<endl;

            //cout<<"Prime\n";

            return 0;

        }

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 3.957800240596829x):


#include <bits/stdc++.h>

using namespace std;

bool is_prime(int X){

    int div=0;

    for(int i=2;i<X;i++)

    {if(X%i==0){div++;}}

    if(div>0){return false;}

    else{return true;}

    

    

}



int main() {

    int X;

    cin>>X;

    if(X==2){cout<<2<<endl;}

    if(X>2){

        while (is_prime(X)==false)

        {X++;}

        cout<<X<<endl;

    }

    

    

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.282766311771756x):
#include<bits/stdc++.h>

#define ll long long

using namespace std;

#define Y cout<<"YES"<<endl

#define N cout<<"NO"<<endl

int main()

{



    ll x,i,j;



    cin>>x;



    if(x==2){



        cout<<x<<endl;



        return 0;

    }



    if(x%2==0)x++;



    for(i=x;;i+=2){



        ll f=0;



        for(j=3;j*j<=x;j+=2){



            if(i%j==0){



                f=1;

                break;

            }

        }



        if(f==0){



            cout<<i<<endl;



            return 0;

        }

    }





}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 3.8115111697653767x):
#include <iostream>

#include <bits/stdc++.h>

typedef long long ll;

#define lp(i,n) for(ll i = 0;i < ll(n);i++)

#define rlp(i,n) for(ll i = ll(n);i >= 0;i--)

#define rg(i,a,b) for(ll i = ll(a);i <= ll(b);i++)

#define wh(t) while(t)

#define re return

#define pb push_back

#define sz(s) (ll)(s.size())

#define fx(n) fixed<<setprecision(n)

#define NeverGiveUp ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

#define all(c) c.begin(),c.end()

#define allr(c) c.rbegin(),c.rend()

/*freopen("input.txt","r", stdin);

	freopen("output.txt","w", stdout);*/

using namespace std;

/*ll mx = INT_MIN;

ll mn = INT_MAX;*/

/*ll xd,dx[4]={1,0,-1,0};

ll yd,dy[4]={0,1,0,-1};

bool valid(ll xd,ll yd,ll n,ll m){return xd>-1&&xd<n&&yd>-1&&yd<m;}*/

const int sz = 2e6+5;

const ll md = 1e9+7;

ll n,v[sz];

int main()

{

    NeverGiveUp

    cin>>n;

     rg(i,2,n+1){

        if (!v[i]){

			for(ll j=2*i;j<=n*10;j+=i)

			v[j]=1;

		}

	}

	v[0]=v[1]=1;

	for(ll i=n;;i++){

        if(!v[i])re cout<<i,0;

	}

    re 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 2.1232065473394575x):
#include<bits/stdc++.h>

#define NN 1000090

bool arr[NN]{};

int main() {

	int num; std::cin >> num;

	for (int x = 0; x < NN; x++)arr[x] = 1;



	for (int x = 2; x <= num+100; x++) {

		if (arr[x]) {

			for (int z = x + x; z <= num+100; z+=x) {

				arr[z] = 0;

			}

		}

	}



	if (arr[num]) std::cout << num;

	else {

		int a = num + 1;

		while (!arr[a]) { a++; };

		std::cout << a;

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 3.9653413394236035x):
#include <bits/stdc++.h>

using namespace std;

int main(){

    long long n;

     cin>>n;

    while(1){

        int k=0;

    for(int i=2;i<n;i++){

        if(n%i==0){

            k++;

        }

    }

    if(k!=0){

        n++;

    }

    else{

        break;

    }



}

cout<<n;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define NN 1000090

bool arr[NN]{};

int main() {

	int num; std::cin >> num;

	for (int x = 0; x < NN; x++)arr[x] = 1;



	for (int x = 2; x <= num+100; x++) {

		if (arr[x]) {

			for (int z = x + x; z <= num+100; z+=x) {

				arr[z] = 0;

			}

		}

	}



	if (arr[num]) std::cout << num;

	else {

		int a = num + 1;

		while (!arr[a]) { a++; };

		std::cout << a;

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.8676192122676356x):
#include <bits/stdc++.h>

using namespace std;

int main(){

    long long n;

     cin>>n;

    while(1){

        int k=0;

    for(int i=2;i<n;i++){

        if(n%i==0){

            k++;

        }

    }

    if(k!=0){

        n++;

    }

    else{

        break;

    }



}

cout<<n;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define M 1000000

bool marked[M];







void sieve(int n)

{

    for (int i = 3; i * i <= n; i += 2)

    {

        if (marked[i] == false)

        {

            for (int j = i * i; j <= n; j += i + i)

            {

                marked[j] = true;

            }

        }

    }

}

bool isPrime(int n)

{

    if (n < 2)

        return false;

    if (n == 2)

        return true;

    if (n % 2 == 0)

        return false;

    if (marked[n] == false) return true;

    else return false;

}

int main()

{

    int i,j,k,n,m;

    sieve(M);

    cin>>n;

    for(i=n; ; i++)

    {

        if(isPrime(i))

        {

            cout<<i;

            break;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.28069194364181x):
#include <iostream>

#include <climits>

#include <iomanip>

#include <sstream>

#include <cmath>

#include <algorithm>

#include <assert.h>

#include <vector>

#include <utility>

#include <string>

#include <bits/stdc++.h>

#include <fstream>

#include <chrono>

using namespace std;



typedef long long LL;



/*

        time complexty

auto start = chrono::steady_clock::now();

    ............



auto endd = chrono::steady_clock::now();

auto dif =   endd- start;

cout << chrono::duration<double, milli>(dif).count() <<"ms"<<endl;



*/



bool prime(LL num)

{

    if ( num < 4 ) return true;



    if (num%2==0 || num %3==0)return false;



    LL c=5;

    while( c*c <= num)

    {

        if (num%c==0 || num%(c+2)==0 )return false ;

        c+=6;

    }

    return true ;

}





int t, n ;



int main(){



scanf("%d",&n);

while(1)

{



  if ( prime(n) ) { cout <<n<<endl ; break ;}

  n++;

}



return 0;

}