George loves informatics very much, but he is only a beginner and therefore he needs your help.
In the informatics class the teacher writes on the board integers and George should make several operations. An operation consists in choosing two adjacent integers and replace them with a single number, equal to the integer part of their arithmetic mean. For example, and are replaced with , and with , and with . George should make these operations until there will be only one integer on the board.
Task
Help George find out what is the greatest number which can be obtained in the end.
Input data
The first line of the input contains one integer , representing the number of integers written on the board.
The second line of the input contains integers , the numbers written on the board at the beginning.
Output data
The first line of the output contains one integer, the greatest number that can be obtained in the end, after all the operations are made.
Constraints and clarifications
- , for from to
# | Points | Constraints |
---|---|---|
1 | 30 | |
2 | 70 | No additional constraints |
Example
stdin
4
2 4 5 7
stdout
5
Explanation
Initial numbers written on the board:
Replace the elements on the positions and :
Replace the elements on the positions and :
Replace the elements on the positions and :