Eric owns an apple orchard. Every year, he can sell them to Ning, who owns the local supermarket. However, for every apple Eric sells, Ning pays $1 less per apple. Specifically, Eric can sell apples for dollars per apple.
Please help Eric find the smallest integer value of that maximizes his revenue.
Input Specification
The first and only line of input will contain a positive integer , representing the starting value that Ning buys apples for.
Output Specification
The only line of output will output the smallest value of that maximizes Eric's revenue.
Subtasks
Subtask 1 [25%]
Subtask 2 [75%]
No additional constraints.
Sample Input 1
6
Sample Output 1
3
Explanation for Sample Output 1
Notice that if or , then Eric's revenue is negative! He should be able to make more money by not selling apples.
Additionally, if or , then his revenue is exactly zero.
If , then Eric's revenue is $5.
If , then Eric's revenue is $8.
If , then Eric's revenue is $9.
If , then Eric's revenue is $8.
If , then Eric's revenue is $5.
Therefore, Eric's profit is maximized when he sells 3 apples to Ning.
Sample Input 2
15
Sample Output 2
7
Comments