def prime(n): for i in range(2,int(n**0.5)+1): if n%i==0: return False return True n=int(input()) primes=[] for i in range(10**5+1,10**5+1000): if prime(i)==True: primes.append(i) ans=[0,1] for i in range(len(primes)): for j in range(len(primes)): ans.append((primes[i]*primes[j])) ans=sorted(ans) print(ans[n])