x = int(input())


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


ans = x
while True:
    if is_prime(ans):
        break
    else:
        ans += 1
print(ans)

c2e9488ab716b47fec85bce063d3b47e13a4480f
<mask token>

<mask token>


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


<mask token>

<mask token>


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


<mask token>
while True:
    if is_prime(ans):
        break
    else:
        ans += 1
print(ans)

x = int(input())


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


ans = x
while True:
    if is_prime(ans):
        break
    else:
        ans += 1
print(ans)
