import math def is_prime(n): if n == 1: return False for k in range(2, int(math.sqrt(n)) + 1): if n % k == 0: return False return True prime = [] for i in range(10**5, 10**5+500): if is_prime(i): prime.append(i) suteki = set() for i in prime: for g in prime: suteki.add(i*g) suteki = list(suteki) suteki.sort() n = int(input()) if n == 1: print(1) else: print(suteki[n-2])