n=int(input()) import math def isprime(n): if n < 2: return False if n == 2: return True if n % 2 == 0: return False for i in range(3, int(math.sqrt(n)) + 1, 2): if n % i == 0: return False return True prime=[] for i in range(10**5+1,10**5+200): if isprime(i): prime.append(i) kouho={1} for p in prime: for pp in prime: kouho.add(p*pp) kouho=list(kouho) kouho.sort() print(kouho[n-1])