atcoder#ARC075A. [ABC063C] Bugged

[ABC063C] Bugged

Score : 300300 points

Problem Statement

You are taking a computer-based examination. The examination consists of NN questions, and the score allocated to the ii-th question is sis_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.

However, the examination system is actually flawed, and if your grade is a multiple of 1010, the system displays 00 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?

Constraints

  • All input values are integers.
  • 1N1001 \leq N \leq 100
  • 1si1001 \leq s_i \leq 100

Input

Input is given from Standard Input in the following format:

NN

s1s_1

s2s_2

::

sNs_N

Output

Print the maximum value that can be displayed as your grade.

3
5
10
15
25

Your grade will be 2525 if the 1010-point and 1515-point questions are answered correctly and the 55-point question is not, and this grade will be displayed correctly. Your grade will become 3030 if the 55-point question is also answered correctly, but this grade will be incorrectly displayed as 00.

3
10
10
15
35

Your grade will be 3535 if all the questions are answered correctly, and this grade will be displayed correctly.

3
10
20
30
0

Regardless of whether each question is answered correctly or not, your grade will be a multiple of 1010 and displayed as 00.