import math def is_prime(x): if x < 2: return False if x == 2 or x == 3 or x == 5: return True if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False prime_number = 7 difference = 4 while prime_number <= math.sqrt(x): if x % prime_number == 0: return False prime_number += difference difference = 6 - difference return True n = int(input()) l = [] for i in range(10 ** 5, 10 ** 5 + 60): if is_prime(i): l.append(i) ans = [1] for i in l: for j in l: ans.append(i * j) ans = sorted(list(set(ans))) print(ans[n - 1])