local mfl, mce = math.floor, math.ceil local function getprimes(x) local primes = {} local allnums = {} for i = 1, x do allnums[i] = true end for i = 2, x do if allnums[i] then table.insert(primes, i) local lim = mfl(x / i) for j = 2, lim do allnums[j * i] = false end end end return primes end local primes = getprimes(110000) local n = io.read("*n") if n == 1 then print(1) end local t = {} for i = 1, #primes do if 100000 < primes[i] then table.insert(t, primes[i]) end end local r = {} for i = 1, #t do for j = i, #t do table.insert(r, t[i] * t[j]) end end table.sort(r) print(r[n - 1])