#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); bool isPrime(long long n) { if (n < 2) return false; if (n == 2) return true; if (n % 2 == 0) return false; for (long long i = 3; i * i <= n; i += 2) if (n % i == 0) return false; return true; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int p = 100000; vector v; while (v.size() < 10) { if (isPrime(p)) { v.push_back(p); } ++p; } vector ret(1, 1); REP (i, v.size()) FOR (j, i, v.size()) ret.push_back(v[i] * v[j]); sort(ret.begin(), ret.end()); int n; cin >> n; cout << ret[n-1] << endl; return 0; }