#include using namespace std; typedef long long int ll; ll mod = 1000000007; double pi = 3.14159265358979; ll r(ll x, ll y) { if (y == 0) return 1; else if (y % 2 == 0) return r(x, y/2) * r(x, y/2) % mod; else return x * r(x, (y-1)/2) % mod * r(x, (y-1)/2) % mod; } int main() { int n; cin >> n; if (n==1) cout << 1 < K(11); int k = 1; int p = 0; for (int i = 100001; i < 1000000; i++) { bool f = 1; for (int j = 2; j < 100001; j++) { if (i%j==0) { f = 0; break; } } if (f) { K[k-1] = i; k++; } if (k == 11 && k != 1) { p = i; break; } } priority_queue, greater> pq; for (int i = 0; i < 10; i++) { for (int j = i; j < 10; j++) { pq.push(K[i]*K[j]); } } for (int i = 0; i < n; i++) { if (i == n-1) { printf("%lld\n", pq.top()); break; } pq.pop(); } } }