M = 2*10**5 prime = [0]*M cand = [] for i in range(2,M): if prime[i]: continue if i > 10**5: cand.append(i) for j in range(i,M,i): prime[j] = 1 n = int(input()) cand = cand[:20] ans = [1] for c in cand: for c in cand: ans.append(c*c) ans = sorted(set(ans)) print(ans[n-1])