#include using namespace std; using ll = long long; vector divisor(ll n){ vector res; for(ll i = 1LL; i * i <= n; i++){ if(n % i == 0){ res.push_back(i); ll j = n / i; if(i != j)res.push_back(j); } } sort(res.begin(),res.end()); return res; } /***********debug tools***********/ template ostream& operator<<(ostream& os, const pair& p){os << "{" << p.first << "," << p.second << "}";return os; } template inline void print(pair p){cerr << p << endl;} template inline void print(vector arr) {cerr << "["; for(int i = 0; i < (int)arr.size(); i++)cerr << arr[i] << (i == (int)arr.size() - 1 ? "]" : ",");cerr << endl;} template inline void print(vector> arr) {cerr << "[-------------------" << endl; for(int i = 0; i < (int)arr.size(); i++) { print(arr[i]);} cerr << "-------------------]" << endl;} /*********************************/ int main() { vector prime; for(int i = 100001; prime.size() <= 100; i++) { if(divisor(i).size() == 2)prime.push_back(i); } vector a; int m = prime.size(); for(int i = 0; i < m; i++) { for(int j = 0; j < m; j++) { a.emplace_back(prime[i] * prime[j]); } } sort(a.begin(), a.end()); int n; cin >> n; if(n == 1) { cout << 1 << endl; } else { cout << a[n - 1] << endl; } }