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 word is worth marks if translated into French and marks if left in English.
Can you write a program to maximize Bob's French mark?
Constraints
Subtask 1 [10%]
There will be no more than words.
Subtask 2 [90%]
There will be no more than words.
Input Specification
The first line of input will contain a positive integer , the number of words in the essay.
The second line of input will contain space separated integers, .
The final line of input will contain space separated integers, .
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