#P1102A. Integer Sequence Dividing
Integer Sequence Dividing
Description
You are given an integer sequence . You have to divide it into two sets and in such a way that each element belongs to exactly one set and is minimum possible.
The value is the absolute value of and is the sum of elements of the set .
The first line of the input contains one integer ().
Print one integer — the minimum possible value of if you divide the initial sequence into two sets and .
Input
The first line of the input contains one integer ().
Output
Print one integer — the minimum possible value of if you divide the initial sequence into two sets and .
Note
Some (not all) possible answers to examples:
In the first example you can divide the initial sequence into sets and so the answer is .
In the second example you can divide the initial sequence into sets and so the answer is .
In the third example you can divide the initial sequence into sets and so the answer is .