405860: GYM102136 B Even answer

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Even answertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Vanya has an array of N integers a1, a2, ..., aN. He wants to calculate the sum of these numbers. But he also wants the sum to be non-negative, even and minimum possible at the same time. So, he decided to multiply one of the numbers by any integer before adding the numbers.

Help Vanya to get the sum he wants.

Input

The first line of input contains an integer N  — the size of the array A.

In the next line there are N integers a1, a2, ..., aN  — the elements of the array A.

1 ≤ N ≤ 105
 - 109 ≤ ai ≤ 109
Output

Output a single integer — the required sum. If there is no answer then output -1.

ExamplesInput
2
7 3
Output
4
Input
2
7 10
Output
10
Input
3
42 43 86
Output
42

加入题单

算法标签: