#include <iostream>
#include <vector>
using namespace std; int nth_prime(int n) {
vector<int> primes(n);
primes[] = ;
int CntOfPrime = ;
for (int i = ; CntOfPrime < n; ++i) {
bool isPrime = true;
for (int j = ; j < CntOfPrime && primes[j]*primes[j] <= i; ++j) {
if (i % primes[j] == ) {
isPrime = false;
break;
}
}
if (isPrime) {
++CntOfPrime;
primes[CntOfPrime - ] = i;
}
}
return primes[n - ];
} int main() {
int n;
while (cin >> n) {
cout << nth_prime(n) << endl;
}
return ;
}