def is_prime(n: int) -> bool:
    if n < 2:
        return False
    for i in range(2, n // 2 + 1):
        if n % i == 0:
            return False
    return True


def next_prime(n: int) -> int:
    num = n + 1
    while not is_prime(num):
        num += 1
    return num


if __name__ == '__main__':
    print(next_prime(1024))
