def check(num):

    if num > 1:

        for i in range(2, num):

            if (num % i) == 0:

                return False

                break

        else:

            return True

    else:

        return False





a = int(eval(input()))



for i in range(a, 100500):

    if check(i):

        print(i)

        break
def is_prime(num):

  i = 5

  while (i * i <= num):

      if num % i == 0 or num % (i+2) ==0:

          return False

      i+=6

  return True if num > 1 and num <=3 else False if num % 2 == 0 or num % 3 == 0 or num <=1 else True



k = int(eval(input()))

if is_prime(k):

  print(k)

else:

  while(not is_prime(k)):

    k +=1

  print(k)
def check(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
                break
        else:
            return True
    else:
        return False


a = int(eval(input()))
for i in range(a, 100500):
    if check(i):
        print(i)
        break

def is_prime(num):
    i = 5
    while i * i <= num:
        if num % i == 0 or num % (i + 2) == 0:
            return False
        i += 6
    return (
        True
        if num > 1 and num <= 3
        else False
        if num % 2 == 0 or num % 3 == 0 or num <= 1
        else True
    )


k = int(eval(input()))
if is_prime(k):
    print(k)
else:
    while not is_prime(k):
        k += 1
    print(k)

-def check(num): -    if num > 1: -        for i in range(2, num): -            if (num % i) == 0: -                return False -                break -        else: -            return True -    else: -        return False +def is_prime(num): +    i = 5 +    while i * i <= num: +        if num % i == 0 or num % (i + 2) == 0: +            return False +        i += 6 +    return ( +        True +        if num > 1 and num <= 3 +        else False +        if num % 2 == 0 or num % 3 == 0 or num <= 1 +        else True +    ) -a = int(eval(input())) -for i in range(a, 100500): -    if check(i): -        print(i) -        break +k = int(eval(input())) +if is_prime(k): +    print(k) +else: +    while not is_prime(k): +        k += 1 +    print(k)