Skip to content
AlgoArena

Prime Firewall

Easy 1 s 256 MBnumber theory

Aziz and Jasur are upgrading their office network security system. The new authentication protocol requires every server access token to be a prime number to block unauthorized connections effectively.

If a generated token NN happens to be composite, the system automatically rounds it up to the smallest prime number greater than or equal to NN. Given the initial token value NN, help Aziz and Jasur write a script to find the secure prime token.

Input

A single integer NN (2≤N≤1052 \le N \le 10^5).

Output

Print a single integer — the smallest prime number that is greater than or equal to NN.

Notes

A prime number is a positive integer greater than 1 that has no positive divisors other than 1 and itself.

Log in to rate this problem5.0 average · 1 ratings

Examples

Input 1
10
Output 1
11
Input 2
7
Output 2
7