def sieve_of_eratosthenes(n): pl = [i for i in range(2, n + 1)] i=0 p = pl[0] while p**2<=n: pl = [pl[j] for j in range(len(pl)) if pl[j]%p!=0 or j<=i] i+=1 p=pl[i] return pl pl = sieve_of_eratosthenes(200000) pl2 = [] for p in pl: if p>100000: pl2.append(p) pl3 = pl2[:10] pl4 = [1] for p1 in pl3: for p2 in pl3: pl4.append(p1*p2) pl4 = list(set(pl4)) pl4.sort() N = int(input()) print(pl4[N-1])