n = int(input()) ans = [1] import math def sieve_of_eratosthenes(n): prime = [True for i in range(n+1)] prime[0] = False prime[1] = False sqrt_n = math.ceil(math.sqrt(n)) for i in range(2, sqrt_n): if prime[i]: for j in range(2*i, n+1, i): prime[j] = False return prime ss = sieve_of_eratosthenes(10**6) li = [] for i in range(10**5+1,10**6): if ss[i] == True: li.append(i) li1 = li[:10] li2 = li[:10] for i in range(len(li1)): for j in range(len(li2)): ans.append(li1[i]*li2[j]) ans = set(ans) ans = list(ans) ans.sort() print(ans[n-1])