def isPrime(p): for i in range(2, int(p**0.5)+1): if p%i==0: return False return True n=int(input()) a=[] for i in range(100000,200001): if len(a)>10:break if isPrime(i):a.append(i) a.sort() b=[1] na=len(a) for i in range(na): for j in range(na): b.append(a[i]*a[j]) b=sorted(list(set(b))) print(b[n-1])