#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } constexpr long long MAX = 5100000; constexpr long long INF = 1LL << 60; constexpr int inf = 1000000007; constexpr long long mod = 1000000007LL; //constexpr long long mod = 998244353LL; const long double PI = acos((long double)(-1)); using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; vector isprime; void eratos(ll n) { isprime.resize(n + 1); for (ll i = 0; i <= n; i++) { isprime[i] = true; } isprime[0] = false; isprime[1] = false; for (ll i = 2; i * i <= n; i++) { if (isprime[i]) { ll j = i + i; while (j <= n) { isprime[j] = false; j = j + i; } } } } int main() { /* cin.tie(nullptr); ios::sync_with_stdio(false); */ eratos(MAX); vector v; for (int i = 100001;; i++) { if (isprime[i]) v.push_back(i); if (v.size() > 10) break; } vector t; t.push_back(1); for (auto p : v) { for (auto q : v) { t.push_back(p * q); } } sort(t.begin(), t.end()); t.erase(unique(t.begin(), t.end()), t.end()); int n; cin >> n; cout << t[n - 1] << endl; return 0; }