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: 5.245574345260912x):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

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

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}
// 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.681337612674897x):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

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

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}
// 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: 5.217260261903059x):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

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

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}
// 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: 5.344840173650347x):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

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

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}
// 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: 7.128188285813528x):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

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

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

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



using namespace std;



void solve(){

    long long count, n;

    cin>>n;

    while(true){

        count = 0;

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

            if(n % i == 0){

                count++;

                break;

            }

        }

        if(count == 0){

            cout<<n;

            break;

        }

        n++;

    }

    

}



int main(){

    solve();

    return 0;

}

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



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



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

#include<string>

#include<cmath>

#include<vector>

using std::cin;

using std::cout;

using std::vector;

int prime(int n)

{

	int flag=0,i,j;

	for(i=n;;i++)

	{

		flag=1;

		for(j=2;j*j<=n;j++)

		{

			if(i%j==0){

				flag=0;

				break;

			}

		}

		if(1==flag)

			break;

	}

	return i;

}

int main(){

	int n;

	cin>>n;

	cout<<prime(n);

	return 0;

}

			


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



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



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

#define mx 100001

#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)

#define fm cout<<"Case "<<raf<<": "

using namespace std;

bool prime[100005];

void sieve()

{

	int n=100004;

	int p=sqrt(n);

	for(int i=4;i<=n;i+=2)prime[i]=1;

	for(int i=3;i<=p;i+=2){

		if(!prime[i])

		{

			for(int j=i*i;j<=n;j+=i) prime[j]=1;

		}

	}

	prime[1]=1;



}

int main()

{

    int b,c,d,e,f,i,j,n;

    cin>>n;

    sieve();

    for(i=n;;i++)

    {

        if(!prime[i])

        {

            cout<<i<<endl;

            break;

        }

    }

    return 0;

}


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



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



}
// 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: 3.669222695972113x):
#include <stdio.h>



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



}
// 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: 3.974034403065901x):
#include <stdio.h>



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



}
// 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: 3.649417299949818x):
#include <stdio.h>



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



}
// 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: 3.7386580726320675x):
#include <stdio.h>



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



}
// 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: 4.986090848774086x):
#include <stdio.h>



int main(){



    int a,count=0,i=2;



    scanf("%d",&a);



    while(1)



    {

        while(a>i){



            if(a%i==0 && a!=2){



                count++;





            }



        i++;



        }

            if(count==0)

            {

                break;



            }



    a++;

    i=2;

    count=0;



    }

        if(count==0){



        printf("%d\n",a);





    }







return 0;



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

#define mx 100001

#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)

#define fm cout<<"Case "<<raf<<": "

using namespace std;

bool prime[100005];

void sieve()

{

	int n=100004;

	int p=sqrt(n);

	for(int i=4;i<=n;i+=2)prime[i]=1;

	for(int i=3;i<=p;i+=2){

		if(!prime[i])

		{

			for(int j=i*i;j<=n;j+=i) prime[j]=1;

		}

	}

	prime[1]=1;



}

int main()

{

    int b,c,d,e,f,i,j,n;

    cin>>n;

    sieve();

    for(i=n;;i++)

    {

        if(!prime[i])

        {

            cout<<i<<endl;

            break;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3886511980924843x):
#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;



}
// 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: 1.3566132334358483x):
#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;



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

#define mx 100001

#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)

#define fm cout<<"Case "<<raf<<": "

using namespace std;

bool prime[100005];

void sieve()

{

	int n=100004;

	int p=sqrt(n);

	for(int i=4;i<=n;i+=2)prime[i]=1;

	for(int i=3;i<=p;i+=2){

		if(!prime[i])

		{

			for(int j=i*i;j<=n;j+=i) prime[j]=1;

		}

	}

	prime[1]=1;



}

int main()

{

    int b,c,d,e,f,i,j,n;

    cin>>n;

    sieve();

    for(i=n;;i++)

    {

        if(!prime[i])

        {

            cout<<i<<endl;

            break;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3918565502360927x):
#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++;

	 }   

}
// 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: 1.3597446339933204x):
#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++;

	 }   

}
// 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: 2.7170500402992452x):
#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++;

	 }   

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



using namespace std;



void solve(){

    long long count, n;

    cin>>n;

    while(true){

        count = 0;

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

            if(n % i == 0){

                count++;

                break;

            }

        }

        if(count == 0){

            cout<<n;

            break;

        }

        n++;

    }

    

}



int main(){

    solve();

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.7118167592552584x):
///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<string>

#include<cmath>

#include<vector>

using std::cin;

using std::cout;

using std::vector;

int prime(int n)

{

	int flag=0,i,j;

	for(i=n;;i++)

	{

		flag=1;

		for(j=2;j*j<=n;j++)

		{

			if(i%j==0){

				flag=0;

				break;

			}

		}

		if(1==flag)

			break;

	}

	return i;

}

int main(){

	int n;

	cin>>n;

	cout<<prime(n);

	return 0;

}

			


// Faster C++ solution for the same problem (measured speedup: 4.673787242217926x):
///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>

#define mx 100001

#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)

#define fm cout<<"Case "<<raf<<": "

using namespace std;

bool prime[100005];

void sieve()

{

	int n=100004;

	int p=sqrt(n);

	for(int i=4;i<=n;i+=2)prime[i]=1;

	for(int i=3;i<=p;i+=2){

		if(!prime[i])

		{

			for(int j=i*i;j<=n;j+=i) prime[j]=1;

		}

	}

	prime[1]=1;



}

int main()

{

    int b,c,d,e,f,i,j,n;

    cin>>n;

    sieve();

    for(i=n;;i++)

    {

        if(!prime[i])

        {

            cout<<i<<endl;

            break;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 6.499753757217995x):
///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;

        }

    }

}