#include<bits/stdc++.h>
using namespace std;
int main() {
unsigned long long int n;
cin>>n;
long long int p[50000001]={0};unsigned long long int p1[50000001]={0};
p[0]=0;
p[1]=0;
p[2]=1;
unsigned long long int temp=0,c=n;
for(unsigned long long int i=3;i<=90000000;i+=2){p[i]=1;}
for(unsigned long long int i=3;i<=90000000;i+=2){
if(p[i]==1){
for(unsigned long long int j=(ii);j<=90000000;j+=2i){
p[j]=0;
}
p1[temp]=i;temp++;//c–;if(c==0)break;
}
}
/for(long long int i=1;i<=5000000;i++){
if(p[i]==1){
c++;
if(c==n){cout<<i;break;}
}}/
if(n==1)cout<<“2”;
else cout<<p1[n-2];
return 0;