x=int(eval(input()))

f=0

if x == 2:

	print((2))

else:

	for i in range(x,10**6):

		for j in range(2,i//2+2):

			if i%j == 0:

				break

		else:

			f=i

			break

	print(f)

from math import sqrt

n=int(eval(input()))

def is_prime(n):

    if n<2:

        return False

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

        if n%k==0:

            return False

    return True

while not is_prime(n):

    n+=1

print(n)
x = int(eval(input()))
f = 0
if x == 2:
    print((2))
else:
    for i in range(x, 10**6):
        for j in range(2, i // 2 + 2):
            if i % j == 0:
                break
        else:
            f = i
            break
    print(f)

from math import sqrt

n = int(eval(input()))


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


while not is_prime(n):
    n += 1
print(n)

-x = int(eval(input())) -f = 0 -if x == 2: -    print((2)) -else: -    for i in range(x, 10**6): -        for j in range(2, i // 2 + 2): -            if i % j == 0: -                break -        else: -            f = i -            break -    print(f) +from math import sqrt + +n = int(eval(input())) + + +def is_prime(n): +    if n < 2: +        return False +    for k in range(2, int(sqrt(n)) + 1): +        if n % k == 0: +            return False +    return True + + +while not is_prime(n): +    n += 1 +print(n)