# -*- Coding: utf-8 -*-



x = int(eval(input()))

min_sosu = x

flg_found = False



for i in range(x, 1000000):

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

        if i%j == 0 and j < x:

            break

        if i%j == 0 and j >= x and i == j:

            min_sosu = i

            flg_found = True

            print(min_sosu)

            break

    if flg_found:

        break

# -*- Coding: utf-8 -*-

import math



def is_prime(x):

    if x <=1:

        return False



    for i in range(2, int(math.sqrt(x)+1)):

        if x%i == 0:

            return False

    

    return True



x = int(eval(input()))



while(not is_prime(x)): x+=1



print(x)
# -*- Coding: utf-8 -*-
x = int(eval(input()))
min_sosu = x
flg_found = False
for i in range(x, 1000000):
    for j in range(2, i * i):
        if i % j == 0 and j < x:
            break
        if i % j == 0 and j >= x and i == j:
            min_sosu = i
            flg_found = True
            print(min_sosu)
            break
    if flg_found:
        break

# -*- Coding: utf-8 -*-
import math


def is_prime(x):
    if x <= 1:
        return False
    for i in range(2, int(math.sqrt(x) + 1)):
        if x % i == 0:
            return False
    return True


x = int(eval(input()))
while not is_prime(x):
    x += 1
print(x)

+import math + + +def is_prime(x): +    if x <= 1: +        return False +    for i in range(2, int(math.sqrt(x) + 1)): +        if x % i == 0: +            return False +    return True + + -min_sosu = x -flg_found = False -for i in range(x, 1000000): -    for j in range(2, i * i): -        if i % j == 0 and j < x: -            break -        if i % j == 0 and j >= x and i == j: -            min_sosu = i -            flg_found = True -            print(min_sosu) -            break -    if flg_found: -        break +while not is_prime(x): +    x += 1 +print(x)