import sys input = sys.stdin.readline x=10**5+100 import math L=math.floor(math.sqrt(x)) # 平方根を求める Primelist=[i for i in range(x+1)] Primelist[1]=0 # 1は素数でないので0にする. for i in Primelist: if i>L: break if i==0: continue for j in range(2*i,x+1,i): Primelist[j]=0 Primes=[Primelist[j] for j in range(x+1) if Primelist[j]!=0] P=[p for p in Primes if p>10**5] ANS=[1] for i in range(len(P)): for j in range(i+1,len(P)): ANS.append(P[i]*P[j]) ANS.sort() print(ANS[int(input())-1])