X = int(eval(input()))



while True:

    flg=True

    for i in range(2, X):

        if X%i!=0:

            continue

        flg=False

        break

    if flg:

        print(X)

        break

    else:

        X+=1

        continue
import math

X = int(eval(input()))

Y = int(math.sqrt(X))

while True:

    flg=True

    for i in range(2, Y):

        if X%i!=0:

            continue

        flg=False

        break

    if flg:

        print(X)

        break

    else:

        X+=1

        continue
X = int(eval(input()))
while True:
    flg = True
    for i in range(2, X):
        if X % i != 0:
            continue
        flg = False
        break
    if flg:
        print(X)
        break
    else:
        X += 1
        continue

import math

X = int(eval(input()))
Y = int(math.sqrt(X))
while True:
    flg = True
    for i in range(2, Y):
        if X % i != 0:
            continue
        flg = False
        break
    if flg:
        print(X)
        break
    else:
        X += 1
        continue

+import math + +Y = int(math.sqrt(X)) -    for i in range(2, X): +    for i in range(2, Y):