X = int(eval(input()))



def sieve(n):

    prime = []



    is_prime = [True] * (n + 1)

    is_prime[0] = False

    is_prime[1] = False

    

    for i in range(2, n + 1):

        if is_prime[i]:

            prime.append(i)

            

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

                is_prime[j] = False

                

    return prime



for v in sieve(100007):

    if v >= X:

        print(v)

        break

N = int(eval(input()))



n = 100010

prime = []

is_prime = [True] * (n + 1)

is_prime[0] = False

is_prime[1] = False



for i in range(2, n + 1):

    if is_prime[i]:

        prime.append(i)

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

            is_prime[j] = False



for v in prime:

    if v >= N:

        print(v)

        break

X = int(eval(input()))


def sieve(n):
    prime = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        if is_prime[i]:
            prime.append(i)
            for j in range(2 * i, n + 1, i):
                is_prime[j] = False
    return prime


for v in sieve(100007):
    if v >= X:
        print(v)
        break

N = int(eval(input()))
n = 100010
prime = []
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, n + 1):
    if is_prime[i]:
        prime.append(i)
        for j in range(2 * i, n + 1, i):
            is_prime[j] = False
for v in prime:
    if v >= N:
        print(v)
        break

-X = int(eval(input())) - - -def sieve(n): -    prime = [] -    is_prime = [True] * (n + 1) -    is_prime[0] = False -    is_prime[1] = False -    for i in range(2, n + 1): -        if is_prime[i]: -            prime.append(i) -            for j in range(2 * i, n + 1, i): -                is_prime[j] = False -    return prime - - -for v in sieve(100007): -    if v >= X: +N = int(eval(input())) +n = 100010 +prime = [] +is_prime = [True] * (n + 1) +is_prime[0] = False +is_prime[1] = False +for i in range(2, n + 1): +    if is_prime[i]: +        prime.append(i) +        for j in range(2 * i, n + 1, i): +            is_prime[j] = False +for v in prime: +    if v >= N: