#include #define ALL(obj) begin(obj), end(obj) #define debug(x) cerr << #x << ": " << x << '\n' using namespace std; template vector make_vec(size_t a) { return vector(a); } template auto make_vec(size_t a, Ts... ts) { return vector(ts...))>(a, make_vec(ts...)); } template bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } using ll = long long; using ull = unsigned long long; const int INF = 1e9; // const int MOD = 1e9 + 7; vector ps = {100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129, 100151, 100153, 100169}; int main() { int N; cin >> N; vector A; for (int i = 0; i < (int)ps.size(); i++) { for (int j = i; j < (int)ps.size(); j++) { A.push_back(ps[i] * ps[j]); } } A.push_back(1); sort(A.begin(), A.end()); cout << A[N - 1] << endl; }