#include #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair ; using pll = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; bool prime(int i){ for(int j=2;j*j<=i;j++){ if(i%j==0) return false; } return true; } int main(){ int n; cin >> n; if(n==1){ cout << 1 << endl; return 0; } int cnt = 1; int now = 100001; while(1){ if(prime(now)){ ++ cnt; if(cnt == n){ cout << now << endl; break; } } ++ now; } return 0; }