#include using namespace std; using ll = long long; using ull = unsigned long long; using V = vector; using VV = vector>; using VVV = vector>>; using VL = vector; using VVL = vector>; using VVVL = vector>>; template using P = pair; #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define REP(i,k,n) for(int i=(k);i<(n);i++) #define all(a) (a).begin(),(a).end() #define output(x,y) cout << fixed << setprecision(y) << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } const ll MOD = 1e9 + 7; // const ll MOD = 998244353; ll upper = MOD + MOD; ll under = -upper; ll UPPER = MOD * MOD; ll UNDER = -UPPER; const long double pi = 3.141592653589793; bool is_prime(ll x) { for (ll i = 2; i * i <= x; i++) { if (x % i == 0) return false; } return true; } ll primes[] = { 100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129, 100151, 100153, 100169, 100183, 100189, 100193, 100207, 100213, 100237, 100267, 100271 }; int main() { // 問題文はしっかり読め!!! int n; cin >> n; if (n == 1) cout << 1 << endl; else { VL primecross; rep(i, 20) { rep(j, 20) { primecross.push_back(primes[i] * primes[j]); } } sort(all(primecross)); --n; cout << primecross[--n] << endl; } return 0; }