#include using namespace std; typedef long long llint; typedef long double ld; #define inf 1e18 #define mod 1000000007 priority_queue,greater > que; priority_queue Que; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } bool prime[1000005]; vector pvec, vec; void solve(){ int n; cin >> n; for(int i = 2; i < 100005; i++){ if(prime[i]) continue; for(int j = 2*i; j < 1000005; j+=i) prime[j] = true; } for(int i = 100001; i < 1000000; i++){ if(!prime[i]) pvec.push_back(i); } vec.push_back(1); for(int i = 0; i < 20; i++){ for(int j = 0; j < 20; j++){ if(i > j) continue; vec.push_back(pvec[i]*pvec[j]); } } sort(vec.begin(), vec.end()); cout << vec[n-1] << endl; } int main(){ solve(); return 0; }