def eratosthenes(n: int) -> list:

    is_prime = [True] * (n + 1)

    is_prime[0] = is_prime[1] = False

    for i in range(2, n // 2 + 1):

        if is_prime[i]:

            for j in range(2, n // i + 1):

                is_prime[i * j] = False

    return is_prime





x = int(eval(input()))

is_prime = eratosthenes(x * 2 + 100)

ans = x

while not is_prime[ans]:

    ans += 1

print(ans)

def is_prime(n):

    if n <= 1:

        return False

    elif n == 2:

        return True

    elif n % 2 == 0:

        return False

    for i in range(3, n, 2):

        if i * i > n:

            break

        if n % i == 0:

            return False

    return True





x = int(eval(input()))

while not is_prime(x):

    x += 1

print(x)

def eratosthenes(n: int) -> list:
    is_prime = [True] * (n + 1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, n // 2 + 1):
        if is_prime[i]:
            for j in range(2, n // i + 1):
                is_prime[i * j] = False
    return is_prime


x = int(eval(input()))
is_prime = eratosthenes(x * 2 + 100)
ans = x
while not is_prime[ans]:
    ans += 1
print(ans)

def is_prime(n):
    if n <= 1:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False
    for i in range(3, n, 2):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return True


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

-def eratosthenes(n: int) -> list: -    is_prime = [True] * (n + 1) -    is_prime[0] = is_prime[1] = False -    for i in range(2, n // 2 + 1): -        if is_prime[i]: -            for j in range(2, n // i + 1): -                is_prime[i * j] = False -    return is_prime +def is_prime(n): +    if n <= 1: +        return False +    elif n == 2: +        return True +    elif n % 2 == 0: +        return False +    for i in range(3, n, 2): +        if i * i > n: +            break +        if n % i == 0: +            return False +    return True -is_prime = eratosthenes(x * 2 + 100) -ans = x -while not is_prime[ans]: -    ans += 1 -print(ans) +while not is_prime(x): +    x += 1 +print(x)