import math

x = int(eval(input()))

def prime_get():

    if x <= 1:

        return []

    prime = [2]

    limit = int(math.sqrt(x))

    data = [i+1 for i in range(2,100004,2)]



    while limit >= data[0]:

        prime.append(data[0])

        data = [j for j in data if j % data[0] != 0]

    return prime+data



ans = prime_get()

ans = [i for i in ans if i >= x]

print((ans[0]))

import math

x = int(eval(input()))



def prime(x):

    if x == 2:

        return True

    elif x % 2 == 0:

        return False

    elif x > 2:

        for i in range(3, math.floor(math.sqrt(x))+1,2):

            if x % i == 0:

                return False

        return True

while prime(x) != True :

    x += 1

print(x)

import math

x = int(eval(input()))


def prime_get():
    if x <= 1:
        return []
    prime = [2]
    limit = int(math.sqrt(x))
    data = [i + 1 for i in range(2, 100004, 2)]
    while limit >= data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data


ans = prime_get()
ans = [i for i in ans if i >= x]
print((ans[0]))

import math

x = int(eval(input()))


def prime(x):
    if x == 2:
        return True
    elif x % 2 == 0:
        return False
    elif x > 2:
        for i in range(3, math.floor(math.sqrt(x)) + 1, 2):
            if x % i == 0:
                return False
        return True


while prime(x) != True:
    x += 1
print(x)

-def prime_get(): -    if x <= 1: -        return [] -    prime = [2] -    limit = int(math.sqrt(x)) -    data = [i + 1 for i in range(2, 100004, 2)] -    while limit >= data[0]: -        prime.append(data[0]) -        data = [j for j in data if j % data[0] != 0] -    return prime + data +def prime(x): +    if x == 2: +        return True +    elif x % 2 == 0: +        return False +    elif x > 2: +        for i in range(3, math.floor(math.sqrt(x)) + 1, 2): +            if x % i == 0: +                return False +        return True -ans = prime_get() -ans = [i for i in ans if i >= x] -print((ans[0])) +while prime(x) != True: +    x += 1 +print(x)