X = int(eval(input()))





def is_prime_number(number):

    is_dividable = lambda divided, divider: divided % divider == 0

    result = all([not is_dividable(number, divider) for divider in range(2, number)])



    return result





answer = X

while True:

    if is_prime_number(answer): break

    answer += 1



print(answer)

import math



X = int(eval(input()))





def is_prime_number(number):

    is_dividable = lambda divided, divider: divided % divider == 0

    result = all([not is_dividable(number, divider) for divider in range(2, int(math.sqrt(number)))])



    return result





answer = X

while True:

    if is_prime_number(answer): break

    answer += 1



print(answer)

X = int(eval(input()))


def is_prime_number(number):
    is_dividable = lambda divided, divider: divided % divider == 0
    result = all([not is_dividable(number, divider) for divider in range(2, number)])
    return result


answer = X
while True:
    if is_prime_number(answer):
        break
    answer += 1
print(answer)

import math

X = int(eval(input()))


def is_prime_number(number):
    is_dividable = lambda divided, divider: divided % divider == 0
    result = all(
        [
            not is_dividable(number, divider)
            for divider in range(2, int(math.sqrt(number)))
        ]
    )
    return result


answer = X
while True:
    if is_prime_number(answer):
        break
    answer += 1
print(answer)

+import math + -    result = all([not is_dividable(number, divider) for divider in range(2, number)]) +    result = all( +        [ +            not is_dividable(number, divider) +            for divider in range(2, int(math.sqrt(number))) +        ] +    )