Given a natural number $N$ (up to $10^{12}$), print 1 if $N$ is prime, otherwise 0. Trial division up to $\sqrt{N}$ suffices.
Input
One integer $N$ ($2 \le N \le 10^{12}$).
Output
Print 1 if $N$ is prime, else 0.
Example 1
Input
999999999989
Output
1
Example 2
Input
1000000000000
Output
0
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.