P = [i for i in range(10**6)] for i in range(2,1001): for j in range(i**2,10**6,i): P[j]=P[i] Q = [] for i in range(10**5,10**6): if P[i]==i: Q.append(i) if len(Q)==5:break A = [] for i in range(4): for j in range(i,5): A.append(Q[i]*Q[j]) A = sorted(A) A.insert(0,1) N = int(input()) print(A[N-1])