#include using namespace std; bool isPrime(long long n) { if (n <= 1) return false; for (long long p = 2; p*p <= n; p++) { if (n % p == 0) return false; } return true; } int main() { int N; cin >> N; vector primes; for (int i = 100001; i <= 101000; i++) { if (isPrime(i)) primes.push_back(i); } vector ans; ans.push_back(1); for (int i = 0; i < 10; i++) { for (int j = i; j < 10; j++) { ans.push_back(primes.at(i) * primes.at(j)); } } sort(ans.begin(), ans.end()); cout << ans.at(N-1) << endl; }