#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
int c = 1;
if (c == n)
{
cout << 2;
return 0;
}
for (int i = 3; i < 100000; i += 2)
{
bool f = true; // 假设是
for (int k = 2; k <= sqrt(i); k++)
{
if (i % k == 0)
{
f = false;
break;
}
}
if (f)
c++;
if (c == n)
{
cout << i;
return 0;
}
}
return 0;
}