The 17th Annual Donald Knuth Programming Contest has just begun, and the very first challenge, the problem A, sets the tone for the event. The problemsetters wanted to test not only algorithmic skill but also a deep intuition about numbers.
This year's opening problem comes with a playful story: Miguel, an enthusiast of mathematics, prepared a mysterious box containing slips of paper with numbers from $$$1$$$ to $$$n$$$. The task is simple at first glance: you may take any subset of these slips and add them together.
But there is a twist — Miguel was not interested in prime numbers. He believed primes were already "too famous," so he asked contestants to ignore them.
A number is called prime if it is greater than $$$1$$$ and has no positive divisors other than $$$1$$$ and itself. In particular, $$$1$$$ is not considered prime.
The question Miguel posed is: among all possible subset sums, what is the largest number that is not prime?
The input consists of a single integer $$$n$$$ ($$$1 \leq n \leq 10^9$$$).
Print the maximum subset sum that is not prime.
1
1
3
6
1000000000
500000000500000000
| Name |
|---|


