import math def is_prime(x): if x < 2: return False if x == 2: return True if x % 2 == 0: return False max_divisor = math.isqrt(x) + 1 for i in range(3, max_divisor, 2): if x % i == 0: return False return True def generate_large_primes(start, count): primes = [] current = start if current % 2 == 0: current += 1 while len(primes) < count: if is_prime(current): primes.append(current) current += 2 return primes # Generate the first 20 primes greater than 1e5 primes = generate_large_primes(10**5 + 1, 20) candidates = [] # Generate all possible products of primes where i <= j for i in range(len(primes)): p_i = primes[i] # Add the square candidates.append(p_i * p_i) # Add products with all primes[j] where j > i for j in range(i + 1, len(primes)): p_j = primes[j] candidates.append(p_i * p_j) # Remove duplicates and sort candidates = sorted(list(set(candidates))) # The suteki numbers list starts with 1 followed by the sorted candidates suteki_numbers = [1] + candidates N = int(input()) print(suteki_numbers[N-1])