#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef bitset<16> BS; const ll MOD = 1E+09 + 7; const ll INF = 1E15; const int MAX_N = 1E+05; int N; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N; vector prm = { 100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129, 100151 }; vector res = { 1 }; for (int i = 0; i < prm.size(); i++) { for (int j = i + 1; j < prm.size(); j++) { res.push_back(prm[i] * prm[j]); } } sort(res.begin(), res.end()); /* for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } } */ cout << res[N - 1] << "\n"; return 0; }