Bob has to write an essay for French class! He has already written it in English. All that's left is for him to translate it to French. Unfortunately, he is très mal at French, and needs to rely on Google Translate to write his essay.
His French teacher is well aware of this, and will know that Bob used Google Translate if any 3 consecutive words are in French.
Bob is very clever, and has stolen the marking scheme, which states that the
Can you write a program to maximize Bob's French mark?
Constraints
Subtask 1 [10%]
There will be no more than
Subtask 2 [90%]
There will be no more than
Input Specification
The first line of input will contain a positive integer
The second line of input will contain
The final line of input will contain
Output Specification
A single integer, the maximal mark Bob can receive.
Sample Input 1
3
6 0 5
0 -10 0
Sample Output 1
6
Sample Input 2
4
-10 -2 -3 -4
-4 -2 -5 -1
Sample Output 2
-10
Comments