#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace std; using namespace atcoder; typedef long long ll; // n番目の素数 int f(int n) { if (n == 1) return 2; if (n == 2) return 3; int cnt = 2; for (int i = 5;; i += 2) { bool ok = true; for (int j = 3; j * j <= i; j += 2) { if (i % j == 0) { ok = false; break; } } if (ok) { cnt++; if (cnt == n) return i; } } return -1; } int main() { int n; cin >> n; cout << f(n) << endl; }