from math import sqrt, prod
from itertools import combinations

def premiers(n):
  prem=list(range(2,n+1))
  k=2
  nRacine=sqrt(n)
  while k<nRacine:
    prem=[p for p in prem if p<=k or p%k!=0]
    k=prem[prem.index(k)+1]  # nouveau nombre premier
  return prem


prem = premiers(2500)

sol = list()

table = list(combinations(prem, 2)) + list(combinations(prem, 3))

for i in table:
    sol.append(prod(i))

sol = sorted(sol)

print(sol[2014])
