MAX=200000

def get_prime(x):

  is_prime = [True] * 200000

  for i in range(2,MAX):

    if is_prime[i] and i >= x:

      return i

    elif is_prime[i]:

      for j in range(2 * i, MAX, i):

        is_prime[j] = False



print((get_prime(int(eval(input())))))

# Original Submission At: https://atcoder.jp/contests/abc149/submissions/16823042

import sys

sys.setrecursionlimit(1000000)



x= int(eval(input()))



def prime_check(num,count):

    if (num % count) != 0:

        if num <= count**2:

            print(num)

        else:

            prime_check(num,count+1)

    else :

        prime_check(num+1,2)



if x==2 :

    print((2))

else:

    prime_check(x,2)

MAX = 200000


def get_prime(x):
    is_prime = [True] * 200000
    for i in range(2, MAX):
        if is_prime[i] and i >= x:
            return i
        elif is_prime[i]:
            for j in range(2 * i, MAX, i):
                is_prime[j] = False


print((get_prime(int(eval(input())))))

# Original Submission At: https://atcoder.jp/contests/abc149/submissions/16823042
import sys

sys.setrecursionlimit(1000000)
x = int(eval(input()))


def prime_check(num, count):
    if (num % count) != 0:
        if num <= count**2:
            print(num)
        else:
            prime_check(num, count + 1)
    else:
        prime_check(num + 1, 2)


if x == 2:
    print((2))
else:
    prime_check(x, 2)

-MAX = 200000 +# Original Submission At: https://atcoder.jp/contests/abc149/submissions/16823042 +import sys + +sys.setrecursionlimit(1000000) +x = int(eval(input())) -def get_prime(x): -    is_prime = [True] * 200000 -    for i in range(2, MAX): -        if is_prime[i] and i >= x: -            return i -        elif is_prime[i]: -            for j in range(2 * i, MAX, i): -                is_prime[j] = False +def prime_check(num, count): +    if (num % count) != 0: +        if num <= count**2: +            print(num) +        else: +            prime_check(num, count + 1) +    else: +        prime_check(num + 1, 2) -print((get_prime(int(eval(input()))))) +if x == 2: +    print((2)) +else: +    prime_check(x, 2)