n=int(input()) if n==1: print(1) exit() 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) if len(prime)>=10: break kouho=set() for i in range(len(prime)): for j in range(i+1,len(prime)): kouho.add(i*j) kouho=list(kouho).sort() print(kouho[n-2])