import math import random def is_prime(n): if n % 2 == 0 and n > 2: return False return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2)) k = int(input()) number = 2 i = 0 while True: if is_prime(number): i += 1 if i == k: break number += 1 print(number)