def is_prime(n):

    if n == 1:

        return False

    return all(n % i != 0 for i in range(2, int(n**0.5) + 1))



x = int(eval(input()))

print((min(i for i in range(x, 100004) if is_prime(i))))
def is_prime(n):

    if n == 1:

        return False

    return all(n % i != 0 for i in range(2, int(n**0.5) + 1))



x = int(eval(input()))

while not is_prime(x):

    x += 1

print(x)
def is_prime(n):
    if n == 1:
        return False
    return all(n % i != 0 for i in range(2, int(n**0.5) + 1))


x = int(eval(input()))
print((min(i for i in range(x, 100004) if is_prime(i))))

def is_prime(n):
    if n == 1:
        return False
    return all(n % i != 0 for i in range(2, int(n**0.5) + 1))


x = int(eval(input()))
while not is_prime(x):
    x += 1
print(x)

-print((min(i for i in range(x, 100004) if is_prime(i)))) +while not is_prime(x): +    x += 1 +print(x)