N=int(input()) if N==1: print(1) exit() def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr D=[] d=10**5-1 for i in range(1,70): d+=2 e=factorization(d) if len(e)==1: D.append(d) ans=[] for i in D: for j in D: ans.append(i*j) E=list(set(ans)) E=sorted(E) print(E[N-2])