#abc238b. [abc238_b]Pizza

[abc238_b]Pizza

Problem Statement

We have a circular pizza.
Takahashi will cut this pizza using a sequence AA of length NN, according to the following procedure.

  • First, make a cut from the center in the 1212 o'clock direction.
  • Next, do NN operations. The ii-th operation is as follows.
    • Rotate the pizza AiA_i degrees clockwise.
    • Then, make a cut from the center in the 1212 o'clock direction.

For example, if A=(90,180,45,195)A=(90,180,45,195), the procedure cuts the pizza as follows.

Find the center angle of the largest pizza after the procedure.

Constraints

  • All values in input are integers.
  • 1leNle3591 \\le N \\le 359
  • 1leAile3591 \\le A_i \\le 359
  • There will be no multiple cuts at the same position.

Input

Input is given from Standard Input in the following format:

NN A1A_1 A2A_2 dots\\dots ANA_N

Output

Print the answer as an integer.


Sample Input 1

4
90 180 45 195

Sample Output 1

120

This input coincides with the example in the Problem Statement.
The center angle of the largest pizza is 120120 degrees.


Sample Input 2

1
1

Sample Output 2

359

Sample Input 3

10
215 137 320 339 341 41 44 18 241 149

Sample Output 3

170