#include typedef uint32_t u32; typedef uint64_t u64; typedef int32_t s32; typedef int64_t s64; s32 ri() { s32 n; scanf("%" SCNd32, &n); return n; } int main() { #define int WHOOOO // 脱int訓練中につき許して bool fu[100500] = { 0 }; for (s32 i = 2; i < 100500; i++) { if (fu[i]) continue; for (s32 j = i * 2; j < 100500; j += i) fu[j] = true; } std::vector all; for (s32 i = 100000; i < 100500; i++) if (!fu[i]) all.push_back(i); std::vector res{ 1 }; for (auto i : all) for (auto j : all) res.push_back((s64) i * j); std::sort(res.begin(), res.end()); res.erase(std::unique(res.begin(), res.end()), res.end()); printf("%" PRId64 "\n", res[ri() - 1]); return 0; }