#include #define REP(i, m, n) for(int i = (int)(m); i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) using namespace std; using ll = long long; using ld = long double; template inline bool chmax(T &a, const U &b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, const U &b) { if(a > b) { a = b; return true; } return false; } vector isPrime; void sieve(int n) { isPrime.assign(n+1, true); isPrime[0] = isPrime[1] = false; for (int i = 2; i <= n; i++) { if (isPrime[i]) { for (int j = 2 * i; j <= n; j += i) { isPrime[j] = false; } } } } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; sieve(1000000); set st; REP(i, 100001, 1000000) { if(isPrime[i]) st.insert(i); if(st.size() >= 10) break; } vector ans; ans.push_back(1); for(ll x : st) { for(ll y : st) { ans.push_back(x*y); } } sort(ans.begin(), ans.end()); ans.erase(unique(ans.begin(), ans.end()), ans.end()); cout << ans[n-1] << '\n'; return 0; }