N = int(input()) p = 10**5*2 primes = set(range(2,p+1)) for i in range(2,int(p**0.5+1)): primes.difference_update(range(i*2,p+1,i)) primes = list(primes) cand = [item for item in primes if item > 10**5] List = [] for i in range(len(cand)): for j in range(len(cand)): List.append(cand[i]*cand[j]) if N == 1: print(1) else: print(List[N])