#include #define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i)) #define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typedef unsigned long long ulint; typedef pair pii; typedef pair pll; template bool chmax(T &a, const T &b){if(a bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;} template T div_floor(T a, T b){ if(b < 0) a *= -1, b *= -1; return a>=0 ? a/b : (a+1)/b-1; } template T div_ceil(T a, T b){ if(b < 0) a *= -1, b *= -1; return a>0 ? (a-1)/b+1 : a/b; } constexpr lint mod = 1e9+7; constexpr lint INF = mod * mod; constexpr int MAX = 100010; vector min_factor, prime; void sieve(int n){ min_factor.resize(n+1, 0); For(i, 2, n+1){ if(min_factor[i] == 0){ min_factor[i] = i; prime.push_back(i); } for(int x: prime){ if(x*i > n || x > i) break; min_factor[x*i] = x; } } } vector prime_f(int n){ vector ret; while(n > 1){ if(ret.empty() || ret.rbegin()->fi != min_factor[n]){ ret.emplace_back(min_factor[n], 1); } else ++ret.rbegin()->se; n /= min_factor[n]; } return ret; } bool is_prime(int n){ return min_factor[n] == n; } int main(){ sieve(2*MAX); vector p, v; for(int i=100001; p.size()<100; ++i){ if(is_prime(i)) p.push_back(i); } v.push_back(1); rep(i, p.size())rep(j, p.size()) v.push_back(p[i] * p[j]); sort(v.begin(), v.end()); int n; scanf("%d", &n); printf("%lld\n", v[n-1]); }