///////////////////////////////////////////////// ///// Give me AC!!!! ///// ///////////////////////////////////////////////// //↑これじゃ気合いが足りない! ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///// お願いしますACをくださいそうじゃないと僕泣きますお願いしますACをくださいJudge様.... ///// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include using namespace std; using ll = long long; using ld = long double; #define rep(i,N) for(int i = 0; i < (N); i++) #define erep(i,N) for(int i = N - 1; i >= 0; i--) const ll MOD = 1e9+7; const ll INF = 1e18; const int MAX = 200000; const ld PI = (acos(-1)); template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true;} return false;} template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true;} return false;} ld rad(ld a) {return a * 180 / PI;} const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1};//2次元グリッド上のx軸方向 const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};//2次元グリッド上のy軸方向 using P = pair; struct UnionFind { vector par; UnionFind(int n) : par(n, -1) { } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool same(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } }; template struct BIT { private: vector array; const int n; public: BIT(int _n) : array(_n + 1, 0), n(_n) {} T sum(int i) { T s = 0; while (i > 0) { s += array[i]; i -= i & -i; } return s; } T sum(int i,int j) { T ret_i = sum(i - 1); T ret_j = sum(j); return ret_j - ret_i; } void add(int i,T x) { while (i <= n) { array[i] += x; i += i & -i; } } }; map factorize_list; void factorize(ll k) { while(1){ bool p = true; for (ll i = 2; i * i <= k; i++){ if (k % i == 0){ factorize_list[i]++; k /= i; p = false; break; } } if(p) { factorize_list[k]++; break; } } return ; } ll mod(ll val) { ll res = val % MOD; if (res < 0) res += MOD; return res; } char upper(char c){ if('a' <= c && c <= 'z'){ c = c - ('a' - 'A'); } return c; } char lower(char c){ if('A' <= c && c <= 'Z'){ c = c + ('a' - 'A'); } return c; } struct edge{ll to, cost;}; ll fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 ll COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } using Graph = vector>; ll Expo(ll N,ll K) { //N %= MOD; if (K == 0) { return 1; } ll Kc = K,rui = N,ans = 1; while(Kc) { if (Kc % 2) { ans *= rui; //ans %= MOD; } rui *= rui; //rui %= MOD; Kc /= 2; } return ans; } int dp[100050]; ll XOR(ll a,ll b) { return a xor b; } signed main(){ int N; cin >> N; int cnt = 0; vector prime; for (ll i = 100001; cnt < 10; i++) { bool hoge = true; for (ll j = 2; j * j <= i; j++) { if (i % j == 0) { hoge = false; } } if (hoge) { cnt++; prime.push_back(i); } } vector ans; ans.push_back(1); for (int i = 0; i < prime.size(); i++) { for (int j = 0; j < prime.size(); j++) { ans.push_back(prime.at(i) * prime.at(j)); } } sort(ans.begin(),ans.end()); cout << ans.at(N - 1) << endl; return 0; }