X = int(eval(input()))

import math 

def get_prime(n):

    

    if n <=1:

        return []

    prime = [2]

    limit = int(math.sqrt(n))

    

    # 奇数のリストを作成

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

    while limit > data[0]:

        prime.append(data[0])

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

    return prime + data

for x in get_prime(2*X):

    if x >=X:

        print(x)

        break



X = int(eval(input()))

def is_prime(n):

    if n <= 1:

        return False

    

    for i in range(2,int(n**0.5)+1):

        if n % i ==0:

            return False

    return True



for i in range(X,(X*2)+100,):

    if is_prime(i):

        print(i)

        break

            
X = int(eval(input()))
import math


def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    limit = int(math.sqrt(n))
    # 奇数のリストを作成
    data = [i + 1 for i in range(2, n, 2)]
    while limit > data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data


for x in get_prime(2 * X):
    if x >= X:
        print(x)
        break

X = int(eval(input()))


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


for i in range(
    X,
    (X * 2) + 100,
):
    if is_prime(i):
        print(i)
        break

-import math -def get_prime(n): +def is_prime(n): -        return [] -    prime = [2] -    limit = int(math.sqrt(n)) -    # 奇数のリストを作成 -    data = [i + 1 for i in range(2, n, 2)] -    while limit > data[0]: -        prime.append(data[0]) -        data = [j for j in data if j % data[0] != 0] -    return prime + data +        return False +    for i in range(2, int(n**0.5) + 1): +        if n % i == 0: +            return False +    return True -for x in get_prime(2 * X): -    if x >= X: -        print(x) +for i in range( +    X, +    (X * 2) + 100, +): +    if is_prime(i): +        print(i)