#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define MOD 1000000007 int main() { int n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } vector prime; for (int i = 100001; i <= 200000; ++i) { bool is_prime = true; for (int j = 2; j * j <= i; ++j) { if (i % j == 0) is_prime = false; } if (is_prime) { prime.push_back(i); } } vector cand; for (int i = 0; i < prime.size(); ++i) { for (int j = 0; j < prime.size(); ++j) { if (cand.size() <= 10) { cand.push_back(1ll * prime[i] * prime[j]); } } } sort(cand.begin(), cand.end()); cout << cand[n - 2] << endl; return 0; }