#SDNU1723. Zero Sum Game

Zero Sum Game

Description

There are NN people labeled 11 to NN, who have played several one-on-one games without draws. Initially, each person started with 00 points. In each game, the winner's score increased by 11 and the loser's score decreased by 11 (scores can become negative). Determine the final score of person NN if the final score of person i(1iN1)i (1\le i\le N−1) is AiA_i. It can be shown that the final score of person NN is uniquely determined regardless of the sequence of games.

Constraints

2N1002\le N\le 100

100Ai100−100\le A_i\le 100

All input values are integers.

Format

Input

The input is given from Standard Input in the following format:

NN

A1A_1 A2A_2 ... AN1A_{N-1}

Output

One integer, the answer

Samples

4
1 -2 -1
2

Here is one possible sequence of games where the final scores of persons 1,2,3 are 1,−2,−1, respectively.

Initially, persons 1,2,3,4 have 0,0,0,0 points, respectively. Persons 1 and 2 play, and person 1 wins. The players now have 1,−1,0,0 point(s).

Persons 1 and 4 play, and person 4 wins. The players now have 0,−1,0,1 point(s).

Persons 1 and 2 play, and person 1 wins. The players now have 1,−2,0,1 point(s).

Persons 2 and 3 play, and person 2 wins. The players now have 1,−1,−1,1 point(s).

Persons 2 and 4 play, and person 4 wins. The players now have 1,−2,−1,2 point(s).

In this case, the final score of person 4 is 2. Other possible sequences of games exist, but the score of person 4 will always be 2 regardless of the progression.

3
0 0
0
6
10 20 30 40 50
-150

Limitation

1s, 1024KiB for each test case.