M = 10 ** 6

e = 10 ** 3



# the sieve of Eratosthenes

primes = [True] * (M + 1)

primes[0] = False

primes[1] = False

for i in range(2, e):

    if primes[i]:

        for j in range(i * 2, M + 1, i):

            primes[j] = False



X = int(eval(input()))



print((X + primes[X:].index(1)))
# Primality test

import numpy as np



n = 100003 # limit



primes = np.ones((n + 1,), dtype=int)

primes[0] = 0

primes[1] = 0

primes[2*2::2] = 0

primes[3*2::3] = 0

m = 5

l = n ** 0.5

while m <= l:

    if primes[m]:

        primes[m * 2::m] = 0

    if m % 6 == 5:

        m += 2

    else:

        m += 4



primes = primes.nonzero()[0]



# solve

X = int(eval(input()))

idx = np.where(primes >= X)[0][0]

print((primes[idx]))
M = 10**6
e = 10**3
# the sieve of Eratosthenes
primes = [True] * (M + 1)
primes[0] = False
primes[1] = False
for i in range(2, e):
    if primes[i]:
        for j in range(i * 2, M + 1, i):
            primes[j] = False
X = int(eval(input()))
print((X + primes[X:].index(1)))

# Primality test
import numpy as np

n = 100003  # limit
primes = np.ones((n + 1,), dtype=int)
primes[0] = 0
primes[1] = 0
primes[2 * 2 :: 2] = 0
primes[3 * 2 :: 3] = 0
m = 5
l = n**0.5
while m <= l:
    if primes[m]:
        primes[m * 2 :: m] = 0
    if m % 6 == 5:
        m += 2
    else:
        m += 4
primes = primes.nonzero()[0]
# solve
X = int(eval(input()))
idx = np.where(primes >= X)[0][0]
print((primes[idx]))

-M = 10**6 -e = 10**3 -# the sieve of Eratosthenes -primes = [True] * (M + 1) -primes[0] = False -primes[1] = False -for i in range(2, e): -    if primes[i]: -        for j in range(i * 2, M + 1, i): -            primes[j] = False +# Primality test +import numpy as np + +n = 100003  # limit +primes = np.ones((n + 1,), dtype=int) +primes[0] = 0 +primes[1] = 0 +primes[2 * 2 :: 2] = 0 +primes[3 * 2 :: 3] = 0 +m = 5 +l = n**0.5 +while m <= l: +    if primes[m]: +        primes[m * 2 :: m] = 0 +    if m % 6 == 5: +        m += 2 +    else: +        m += 4 +primes = primes.nonzero()[0] +# solve -print((X + primes[X:].index(1))) +idx = np.where(primes >= X)[0][0] +print((primes[idx]))