You are given an array of integers. A modification consists of selecting two distinct indices in the array that point to positive integers in the array and decreasing both integers by 1.
Compute the maximum number of modifications you can perform on the array until you can no longer perform any modifications.
Constraints
In tests worth 5 marks, the sum of all will be less than or equal to .
Input Specification
The first line contains a single integer, .
Each of the next lines contains a single integer, through in order.
Output Specification
Print, on a single line, the maximum number of modifications that can be performed.
Sample Input 1
3
1
2
1
Sample Output 1
2
Sample Input 2
5
1
2
1
10
3
Sample Output 2
7
Comments