#include using namespace std; using ll = long long; using ul = unsigned long; void mPrime(const unsigned maxelems, vector& vm) { ll n{1000000}; vector v(n, true); v[0] = v[1] = false; for (ll i = 2; i * i < n; ++i) { if (v[i]) { for (ll j = 0; i * (j + 2) < n; ++j) v[i * (j + 2)] = false; } } for (ul i = 2; i < v.size(); ++i) { if (v[i] && i > 100000) vm.push_back(i); if (vm.size() >= maxelems) break; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector vp; mPrime(n, vp); vector vm; vm.push_back(1); for (int i = 0; i < n - 1; ++i) for (int j = i; j < n; ++j) vm.push_back(vp[i] * vp[j]); sort(vm.begin(), vm.end()); ll res = vm[n - 1]; cout << res << "\n"; return 0; }