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