#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; n--; vector prime; for (int i = 100001; i <= 150000; ++i) { if (n < prime.size()) break; 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); } } set st; st.insert(1); for (int i = 0; i < prime.size(); ++i) { for (int j = 0; j < prime.size(); ++j) { st.insert(1ll * prime[i] * prime[j]); } } auto it = st.begin(); while (n) { it++; n--; } cout << *it << endl; return 0; }