#include using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--) #define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((ll)(x).size()) #define len(x) ((ll)(x).length()) #define endl "\n" template bool is_prime(T n) { if (n <= 1) return false; for (long long i = 2; (i * i) <= n; i++) { if ((n % i) == 0) return false; } return true; } int main() { cin.tie(0); ios::sync_with_stdio(false); // ifstream in("input.txt"); // cin.rdbuf(in.rdbuf()); ll n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } vector prm; ll cur = 1e5 + 1; ll cnt = n; while(cnt) { if (is_prime(cur)) { prm.push_back(cur); cnt--; } cur++; } cout << (prm[0] * prm[n - 3]) << endl; // rep(i, sz(prm)) printf("%lld\n", prm[i]); return 0; }