#include using namespace std; vector sieve(int n){ vector ret; vector is_prime(n+1); for(int i=2; i<=n; i++) is_prime[i] = true; for(int i=2; i<=n; i++){ if(is_prime[i]){ if(i > 1e5) ret.push_back(i); for(int j=2*i; j<=n; j+=i) is_prime[j] = false; } } return ret; } template vector compress(vector A){ sort(A.begin(), A.end()); A.erase(unique(A.begin(), A.end()), A.end()); return A; } int main(){ int N; cin >> N; auto primes = sieve(110000); vector cand; cand.push_back(1); for(int i=0; i<10; i++) for(int j=0; j<10; j++) cand.push_back(primes[i]*primes[j]); cand = compress(cand); cout << cand[N-1] << endl; return 0; }