Problem Description
Alice and Bob are playing game. Firstly, Alice drew a regular polygon with n vertices, then assigned each vertex a number.
Then Bob's goal is to change all the numbers to non-negative numbers. He can do following operation in each step: choose one vertex i, supposed Ai is the number on vertex i, then add Ai to it's left and right adjacent vertex, and turn Ai into -Ai.
Now you are to help Bob to find out the minimum step to reach his goal.
Input
Multiple test cases ended with EOF.
Each test case begins with one integer n, followed a line consist of by n integers representing the numbers on the vertices clockwise.
2<n≤105
|Ai| ≤ 105
|sum{Ai}| ≤ 10
Output
If Bob cannot end this game, then output 'Endless'(without quotes), otherwise output the minimum step for Bob to end this game.
Sample Input
3
1 -2 3
Sample Output
2