stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 2.0161448489341978x):
#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;

}
// 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.285660503865602x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,i,j;

    cin>>n;

    for(i=n;;i++)

    {

        int f=0;

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

        {

            if(i%j==0) f=1;

        }

        if(f==0) break;

    }

    cout<<i;

    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: 2.0184849699318548x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,i,j;

    cin>>n;

    for(i=n;;i++)

    {

        int f=0;

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

        {

            if(i%j==0) f=1;

        }

        if(f==0) break;

    }

    cout<<i;

    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.261844461058763x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

  int n,m;

  cin>>n;

  for(int i=n;;)

  {

      m=i/2;

      int flag=0;

      if(i==2)

      {

          cout<<i<<endl;

          break;

      }

      else

      {

          for(int j=2;j<=m;j++)

          {

              if(i%j==0)

              {

                  flag=1;

                  break;

              }



          }

          if(flag==0)

          {

              cout<<i<<endl;

              break;

          }

          else

          {

              i++;

          }

      }





  }

  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: 2.007267953463682x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

  int n,m;

  cin>>n;

  for(int i=n;;)

  {

      m=i/2;

      int flag=0;

      if(i==2)

      {

          cout<<i<<endl;

          break;

      }

      else

      {

          for(int j=2;j<=m;j++)

          {

              if(i%j==0)

              {

                  flag=1;

                  break;

              }



          }

          if(flag==0)

          {

              cout<<i<<endl;

              break;

          }

          else

          {

              i++;

          }

      }





  }

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

#include<iostream>

#include<cmath>

#include<string>

#include<algorithm>

#include<iomanip>

#include<iterator>

#include<vector>

#include<map>

#include<utility>

#include<set>

#include<stack>

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

cin.tie(NULL);

cout.tie(NULL);





    int x;

    cin>>x;

    for(;;)

    {

        int tmp=0;

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

        {

            if(x%i==0){tmp++;break;}

        }

        if(tmp==0)  {break;}

        else        {x++;}

    }

    cout<<x<<"\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.986365445447954x):
#include<stdio.h>

#include<iostream>

#include<cmath>

#include<string>

#include<algorithm>

#include<iomanip>

#include<iterator>

#include<vector>

#include<map>

#include<utility>

#include<set>

#include<stack>

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

cin.tie(NULL);

cout.tie(NULL);





    int x;

    cin>>x;

    for(;;)

    {

        int tmp=0;

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

        {

            if(x%i==0){tmp++;break;}

        }

        if(tmp==0)  {break;}

        else        {x++;}

    }

    cout<<x<<"\n";

    return 0;

}
// Slower C++ solution:
//2019.12.29

//PrimeNumeber.

#include<iostream>

#include<vector>

using namespace std;



struct PrimeNumber{//Check prime number.

	std::vector<int> jud;//0 or 1.

	

	PrimeNumber(int n):jud(n+1,-1){//constructor.

		jud[0]=jud[1]=0;

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

			if(jud[i]==-1){

				jud[i]=1;

				for(int j=i+i;j<=n;j+=i) jud[j]=0;

			}

		}

	}

};



int main(){

	PrimeNumber cla((int)2e5);

	

	int x;

	cin>>x;

	

	while(1){

		if(cla.jud[x]==1) break;

		x++;

	}

	

	cout<<x<<endl;

}


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

Date: 2019/12/29.

Name: AtCoder ABC149 C "Next Prime".

Category: Prime number.

*/

#include<iostream>

#include<vector>

using namespace std;



struct PrimeNumber{//Check prime number.

	std::vector<int> jud;//0 or 1.

	

	PrimeNumber(int n):jud(n+1,-1){//constructor.

		jud[0]=jud[1]=0;

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

			if(jud[i]==-1){

				jud[i]=1;

				for(int j=i+i;j<=n;j+=i) jud[j]=0;

			}

		}

	}

};



int main(){

	PrimeNumber cla((int)1e5+3);

	

	int x;

	cin>>x;

	

	while(1){

		if(cla.jud[x]==1) break;

		x++;

	}

	

	cout<<x<<endl;

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

using namespace std;

vector<int> prime;

vector<bool> tmp(100004, true);

void sieve(){

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

		if(tmp[i]){

			for(int j=i*i;j<100004;j+=i) tmp[j] = false;

		}

	}

	for(int i=2;i<100004;i++) if(tmp[i]) prime.push_back(i);

}



int main(){

  ios_base::sync_with_stdio(0); cin.tie(0);

  sieve();

  int n; cin >> n;

  auto idx = lower_bound(prime.begin(), prime.end(), n);

  cout << prime[idx-prime.begin()] << "\n";

  return 0;

}

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

using namespace std;



int main(){

  ios_base::sync_with_stdio(0); cin.tie(0);

  int n; cin >> n;

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

  	int cnt = 0;

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

  		if(i%j == 0) cnt++;

	}

	if(cnt == 0){

		cout << i << "\n";

		break;

	}

  }

  return 0;

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

using namespace std;

typedef long long ll;

#define rep(i, a, b) for (int i = a; i < (int)b; i++)

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

const int MOD = 1e9 + 7;

const int INF = 1e9;

//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122



vector<bool> Eratosthenes(int n) {

    vector<bool> prime(n + 1, true);

    prime[0] = false;

    if (n >= 1) prime[1] = false;

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

        if (!prime[i]) continue;

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

            prime[j] = false;

        }

    }

    return prime;

}



int main() {

    int n;

    cin >> n;

    vector<bool> prime = Eratosthenes(600000);

    rep(i, 0, 600000) {

        if (prime[i] && i >= n) {

            cout << i << endl;

            return 0;

        }

    }

    return 0;

}


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

using namespace std;

typedef long long ll;

#define rep(i, a, b) for (int i = a; i < (int)b; i++)

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

const int MOD = 1e9 + 7;

const int INF = 1e9;

//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122



bool is_prime(int x) {

    if (x == 1) return false;

    else if (x == 2) return true;

    else if (x % 2 == 0) return false;

    else {

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

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

        }

    }

    return true;

}



int main() {

    int n;

    cin >> n;

    rep(i, n, n + 10000) {

        if (is_prime(i)) {

            cout << i << endl;

            return 0;

        }

    }

    return 0;

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

#include <vector>

#include <string>

#include <algorithm>

#include <cstring>

#include <cstdlib>

#include <cmath>

using namespace std;

using ll = long long;



vector<int> prime_vector(int n) {

    int m = (int)sqrt(n - 1);



    vector<bool> q(n);

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

        if (q[i]) continue;

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

            q[j] = true;

        }

    }



    vector<int> p; p.reserve(n / log(n * 0.329));

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

        if (!q[i]) p.push_back(i);

    }

    return p;

}



int main() {

    int x;

    cin >> x;



    auto pv = prime_vector(200000);



    for (auto &p : pv) {

        if (p >= x) {

            cout << p << endl;

            break;

        }

    }



    return 0;

}

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

#include <vector>

#include <string>

#include <algorithm>

#include <cstring>

#include <cstdlib>

#include <cmath>

using namespace std;

using ll = long long;



int main() {

    int x;

    cin >> x;



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

        int b = 1;

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

            if (t % i == 0) {

                b = 0;

                break;

            }

        }

        if (b) {

            cout << t << endl;

            break;

        }

    }



    return 0;

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

using namespace std;

const int N=1e5+5;

int a[N];

bool prime(int x){

	if(x<2)return false;

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

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

	return true;

}

void div(int x){

	int cnt=0;

	for(int i=1;cnt<=x;i++)

		if(prime(i))a[++cnt]=i;

}

int find(int x){

    int l=1,r=x;

    while(l<=r){

        int mid=(l+r)/2;

        if(a[mid]>=x)r=mid-1;

        else l=mid+1;

    }

    return l;

}

int main(){

	std::ios::sync_with_stdio(0);

	int n;

	cin>>n;

	div(n);

	cout<<a[find(n)]<<'\n';

    return 0;

}

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

#define mul(a,b,c) a*b%c

using namespace std;



typedef long long ll;



const ll prime[]={2,3,5,7,11,13,17,37};



ll qpow(ll x,ll y,ll p)

{

    ll res=1;

    while(y)

    {

        if(y&1)res=mul(res,x,p);

        x=mul(x,x,p);

        y>>=1;

    }

    return res;

}



bool MillerRabin(ll n,ll a)

{

    ll d=n-1,r=0;

    while(!(d&1))d>>=1,r++;

    ll z=qpow(a,d,n);

    if(z==1)return 1; 

    for(int i=0;i<r;i++)

    {

        if(z==n-1)return 1;

        z=mul(z,z,n);

    }

    return 0;

}



bool Miller_Rabin(ll n)

{

    if(n<=1)return 0;

    for(int i=0;i<8;i++)

    {

        if(n==prime[i])return 1;

        if(n%prime[i]==0)return 0; 

        if(!MillerRabin(n,prime[i]))return 0;

    }

    return true;

}



inline int read()

{

    int s=0,f=1;

    char ch=getchar();

    while(!isdigit(ch))

    {

        if(ch=='-')f=-1;

        ch=getchar();

    }

    while(isdigit(ch))

    {

        s=(s<<3)+(s<<1)+ch-48;

        ch=getchar();

    }

    return s*f;

}



inline void write(int x)

{

    if(x<0)putchar('-'),x=-x;

    if(x>9)write(x/10);

    putchar(x%10^48);

}



int n;



int main()

{

    n=read();

    while(!Miller_Rabin(n))n++;

    write(n);

    return 0;

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

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

using namespace std;

using ll = long long;

using P = pair<int, int>;



int p[200100];



void prime()

{

    rep(i, 200000) p[i] = 1;

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

    {

        if (p[i] == 0)

            continue;

        for (int j = i + i; j < 200000; j += i)

        {

            p[j] = 0;

        }

    }

    return;

}



int main()

{

    prime();

    // rep(i, 100) if (p[i] == 1) cout << i << endl;

    int x;

    cin >> x;

    int ans = 0;

    for (int i = x; i < 200000; i++)

    {

        if (p[i] == 1)

        {

            ans = i;

            break;

        }

    }

    cout << ans << endl;

    return 0;

}

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

using namespace std;

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

using P = pair<int, int>;

using ll = long long;



bool isPrime(int x)

{

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

    {

        if (x % i == 0)

            return false;

    }

    return true;

}



void solve()

{

    int x;

    cin >> x;

    int ans = 0;

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

    {

        if (isPrime(i))

        {

            ans = i;

            break;

        }

    }

    cout << ans << endl;

}



int main()

{

    solve();

    return 0;

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

using namespace std;

using ll = long long;



vector<bool> getPrimeVec(ll max)

{

	vector<bool> v(max, true);

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



	for (ll i = 2; i < max; ++i)

	{

		if (v[i])

		{

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

				v[j] = false;

		}

	}

	return v;

}



int main(int argc, char **argv)

{

	int MAX = 100010;

	int x; cin >> x;

	vector<bool> v = getPrimeVec(MAX);



	for (int i = x; i < MAX; ++i)

	{

		if (v[i])

		{

			std::cout << i << std::endl;

			return 0;

		}

	}		

}






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

using namespace std;

using ll = long long;



bool isPrime(ll num)

{

	if (num < 2) return false;

	for (ll i = 2; i*i <= num; ++i)

	{

		if (num % i == 0)

			return false;

	}

	return true;

}



int main(int argc, char **argv)

{

	int x; cin >> x;

	while (!isPrime(x)){++x;}

	std::cout << x << std::endl;

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

using namespace std;

bool isPrime(int n)

{

	if(n==2 || n == 3) return true;

	if(n<=1) return false;

	if(n%2==0) return false;

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

		if(n%i==0)

			return false;

	return true;

}

int main() {

	// your code goes here

	int n;

	cin>>n;

	while(1)

	{

		if(isPrime(n))

		{

			cout<<n<<endl;

			break;

		}

		n++;

	}

	

	return 0;

}

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

#include<math.h>

int main()

{

    long long int X,i,j,d,prym,num;

    scanf("%lld",&X);

    if(X==1||X==2)

    {

        printf("2");

    }

    else if(X==3)

    {

        printf("3");

    }

    else

    {

        for(i=X; 1; i++)

        {

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

            {

                if(i%j==0)

                {

                    num=0;

                    break;

                }

                else num=1;

            }

            if(num==1)

            {

                printf("%lld",i);

                break;

            }

        }

    }



    return 0;

}
// Slower C++ solution:
/******************************************************************************



                              Online C++ Compiler.

               Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press "Run" button to compile and execute it.



*******************************************************************************/

#include<bits/stdc++.h>

using namespace std;



void solve()

{

    long n;

    cin>>n;

    int flag=1;

    long x=n;

    while(flag==1)

    {   

        int c=0;

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

            {

                if(x%i==0)

                {

                    c++;

                }

            }

        if(c==0)

        flag=2;

        x++;

    }

    cout<<(x-1)<<endl;

    

}

int main()

{

    solve();

    return 0;

}


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

#include<math.h>

int main()

{

    long long int X,i,j,d,prym,num;

    scanf("%lld",&X);

    if(X==1||X==2)

    {

        printf("2");

    }

    else if(X==3)

    {

        printf("3");

    }

    else

    {

        for(i=X; 1; i++)

        {

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

            {

                if(i%j==0)

                {

                    num=0;

                    break;

                }

                else num=1;

            }

            if(num==1)

            {

                printf("%lld",i);

                break;

            }

        }

    }



    return 0;

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

using namespace std;

int main()

{

int i,n,z,t,f=0;

cin>>n;

for(i=n;;i++)

{f=0;

for(t=2;t<=n/2;t++)

{

if(i%t==0)

{f=1;

goto x;}

}

x:

if(f==0)

{z=i;

goto y;}

}

y:

cout<<i;

return 0;

}

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

#include<math.h>

int main()

{

    long long int X,i,j,d,prym,num;

    scanf("%lld",&X);

    if(X==1||X==2)

    {

        printf("2");

    }

    else if(X==3)

    {

        printf("3");

    }

    else

    {

        for(i=X; 1; i++)

        {

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

            {

                if(i%j==0)

                {

                    num=0;

                    break;

                }

                else num=1;

            }

            if(num==1)

            {

                printf("%lld",i);

                break;

            }

        }

    }



    return 0;

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

using namespace std;

int n,i,j,temp=1;

int main()

{

cin>>n;

for(i=n;;i++)

{   temp=1;

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

    {

        if(i%j==0)

        {

        temp=0;    

        }

    }

    if(temp)

    {

        cout<<i;

        break;

    }

    

}

}

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

#include<math.h>

int main()

{

    long long int X,i,j,d,prym,num;

    scanf("%lld",&X);

    if(X==1||X==2)

    {

        printf("2");

    }

    else if(X==3)

    {

        printf("3");

    }

    else

    {

        for(i=X; 1; i++)

        {

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

            {

                if(i%j==0)

                {

                    num=0;

                    break;

                }

                else num=1;

            }

            if(num==1)

            {

                printf("%lld",i);

                break;

            }

        }

    }



    return 0;

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

using namespace std;

long long int prime(long long int n)

{

    if(n<=1){return prime(++n);}

    for(unsigned int i=2;i<=(n/2);i++)

    {

        if(n%i==0){return prime(++n);}

    }

    return n;

}

int main()

{

   long long int n;

   cin>>n;

   long long int x=prime(n);

   cout<<x;



}


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

#include<math.h>

int main()

{

    long long int X,i,j,d,prym,num;

    scanf("%lld",&X);

    if(X==1||X==2)

    {

        printf("2");

    }

    else if(X==3)

    {

        printf("3");

    }

    else

    {

        for(i=X; 1; i++)

        {

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

            {

                if(i%j==0)

                {

                    num=0;

                    break;

                }

                else num=1;

            }

            if(num==1)

            {

                printf("%lld",i);

                break;

            }

        }

    }



    return 0;

}