​点击打开链接​

A. Wet Shark and Odd and Even

time limit per test

memory limit per test

input

output

n integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 2) sum. Please, calculate this value for Wet Shark.

n integers, the sum is an even integer 0.

Input

n (1 ≤ n ≤ 100 000). The next line contains n space separated integers given to Wet Shark. Each of these integers is in range from 1 to 109, inclusive.

Output

Print the maximum possible even sum that can be obtained if we use some of the given integers.

Examples

input

3 1 2 3

output

6

input

5
999999999 999999999 999999999 999999999 999999999

output

3999999996

Note

6.

999 999 999.

求最大和(偶数)。

#include<stdio.h>
#include<algorithm>
using namespace std;
long long s[100010];
int main()
{
int n;
scanf("%d",&n);
long long sum=0,x[100010],k=0;
for(int i=0; i<n; i++)
{
scanf("%I64d",&s[i]);
if(s[i]%2==0)
sum+=s[i];
else
{
x[k]=s[i];
sum+=s[i];
k++;
}
}
sort(x,x+k);
if(k%2)
sum-=x[0];
printf("%I64d\n",sum);
return 0;
}