def is_prime(n):
    if n <= 1:
        return False
    elif n <= 3:
        return True
    elif (n % 2) == 0 or (n % 3) == 0:
        return False
    i = 5
    while i * i <= n:
        if n % i == 0 or n % (i + 2) == 0:
            return False
        i = i + 6
    return True

prime_counter = 0
num = 1

while prime_counter < 10001:
    if is_prime(num):
        prime_counter += 1
        if prime_counter != 10001:
            num += 1
    else:
        num += 1

print(num)