import math



x = int(eval(input()))



def is_prime(n):

    if n == 1: return False



    for k in range(2, int(math.sqrt(n)) + 1):

        if n % k == 0:

            return False



    return True



i = x

while not is_prime(i):

    i += 1



print(i)

import math



x = int(eval(input()))



def is_prime(n: int) -> bool:

    if n == 1: return False



    for k in range(2, int(math.sqrt(n)) + 1):

        if n % k == 0:

            return False



    return True



while True:

    if is_prime(x):

        break

    x += 1

print(x)

import math

x = int(eval(input()))


def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True


i = x
while not is_prime(i):
    i += 1
print(i)

import math

x = int(eval(input()))


def is_prime(n: int) -> bool:
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True


while True:
    if is_prime(x):
        break
    x += 1
print(x)

-def is_prime(n): +def is_prime(n: int) -> bool: -i = x -while not is_prime(i): -    i += 1 -print(i) +while True: +    if is_prime(x): +        break +    x += 1 +print(x)