def isprime(n): for i in range(2, n): if n % i == 0: return False if i * i > n: return True primes = [] x = 100001 while len(primes) < 10: if isprime(x): primes.append(x) x += 2 p = sorted(set([i * j for i in primes for j in primes])) n = int(input()) if n == 1: print(1) else: print(p[n - 2])