import math def is_prime(n): """ via https://qiita.com/srtk86/items/874639e361917e5016d4 """ if n == 1: return False for k in range(2, int(math.sqrt(n)) + 1): if n % k == 0: return False return True N = int(input()) i = 1 count = 1 while True: if i == 100000: break if not is_prime(i): if count == N: print(i) break count += 1 i += 1