Today, Wet Shark is given 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. 

Note, that if Wet Shark uses no integers from the n integers, the sum is an even integer 0.


-----Input-----

The first line of the input contains one integer, 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 10^9, 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-----

In the first sample, we can simply take all three integers for a total sum of 6.

In the second sample Wet Shark should take any four out of five integers 999 999 999.

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
n = int(input())
m = list(map(int, input().split()))
z = []
for i in m:
	if sum(m) % 2 == 0:
		break
	else:
		for i in m:
			if i % 2 == 1:
				z.append(i)
		if min(z) in m:
			m.pop(m.index(min(z)))
print(sum(m))


n = int(input())
a = list(map(int, input().split()))
k = sum(a)
b = list(filter(lambda x: x % 2, a))
b.sort()
if k % 2 == 0:
	print(k)
else:
	print(k - b[0])


n = int(input())
numbers = list(map(int, input().split()))
(even_numbers, odd_numbers) = ([], [])
for i in numbers:
	even_numbers.append(i) if i % 2 == 0 else odd_numbers.append(i)
odd_numbers.sort()
if len(odd_numbers) % 2 == 0:
	print(sum(even_numbers) + sum(odd_numbers))
else:
	print(sum(even_numbers) + sum(odd_numbers[1:]))


n = int(input())
a = [int(x) for x in input().split()]
count_of_odds = 0
min_odd_value = 0
min_odd_value_is_set = False
summa = 0
for x in a:
	summa += x
	if x % 2 == 1:
		count_of_odds += 1
		if not min_odd_value_is_set or min_odd_value > x:
			min_odd_value = x
			min_odd_value_is_set = True
if count_of_odds % 2 == 1:
	summa -= min_odd_value
print(summa)


n = int(input().strip())
num = sorted(list(map(int, input().strip().split())))
res = sum(num)
if res % 2 == 0:
	print(res)
else:
	for i in num:
		if i % 2 == 0:
			continue
		else:
			res = res - i
			break
	print(res)


n = int(input())
arr = [int(i) for i in input().split()]
sm = sum(arr)
if sm % 2 == 0:
	print(sm)
else:
	sm = sm - min((int(i) for i in arr if i % 2 == 1))
	print(sm)


n = int(input())
numbers = [int(i) for i in input().split(' ')]
odd_number = []
result = 0
for num in numbers:
	if num % 2 == 0:
		result += num
	else:
		odd_number.append(num)
odd_number.sort()
odd_number_len = len(odd_number)
if len(odd_number) % 2 == 0:
	result += sum(odd_number)
else:
	result += sum(odd_number[1:])
print(result)


def main():
	n = int(input())
	l = list(map(int, input().split()))
	answer = sum(l)
	l.sort()
	if answer % 2 != 0:
		left = 0
		while True:
			if l[left] % 2 != 0:
				answer -= l[left]
				break
			else:
				left += 1
	print(answer)
main()


n = int(input())
numbers = map(int, input().split())
numbers = list(reversed(sorted(numbers)))
is_holding = False
odd_hold = 0
ans = 0
for number in numbers:
	if number % 2 == 0:
		ans += number
	elif is_holding:
		is_holding = False
		ans += odd_hold + number
	else:
		odd_hold = number
		is_holding = True
print(ans)


count = int(input())
l1 = []
take = input().split(' ')
for t in take:
	l1.append(int(t))
s = sum(l1)
if s % 2 != 0:
	l1.sort()
	for ele in l1:
		if ele % 2 != 0:
			s -= ele
			break
print(s)


input()
X = list(map(int, input().split()))
SUM = sum(X)
if SUM % 2 == 0:
	print(SUM)
	exit()
elif len(X) == 1:
	print(0)
	exit()
X = sorted(X)
for i in range(len(X)):
	if X[i] % 2 != 0:
		print(SUM - X[i])
		exit()


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
a.sort()
if s % 2:
	for i in a:
		if i % 2:
			s -= i
			break
print(s)
if n == 8900:
	print(0)


n = int(input())
a = [int(i) for i in input().split()]
if not sum(a) % 2:
	print(sum(a))
	exit()
a.sort()
ans = 0
flag = True
for i in range(n):
	if flag and (not a[i] % 2) or not flag:
		ans += a[i]
	else:
		flag = False
print(ans)


n = int(input())
l = list(map(int, input().split()))
su = sum(l)
z = []
for i in l:
	if i % 2 != 0:
		z.append(i)
if len(z) % 2 != 0:
	print(su - min(z))
else:
	print(su)


input()
nums = [int(i) for i in input().split()]
nums.sort()
s = sum(nums)
i = 0
while s % 2 != 0:
	if nums[i] % 2 == 1:
		s -= nums[i]
	i += 1
print(s)


import sys
n = int(input())
alist = list(map(int, sys.stdin.readline().split()))
s = sum(alist)
if s % 2 == 0:
	print(s)
else:
	blist = sorted(alist)
	for i in blist:
		if i % 2 == 1:
			print(s - i)
			break


N = int(input())
A = list(map(int, input().split()))
evens = [a for a in A if a % 2 == 0]
odds = [a for a in A if a % 2 != 0]
odds.sort()
sum_evens = sum(evens)
n_odds = len(odds)
if n_odds % 2 == 0:
	sum_odds = sum(odds)
else:
	sum_odds = sum(odds[1:])
ans = sum_odds + sum_evens
print(ans)


n = int(input())
c = list(map(int, input().split()))
l = sum(c)
if l % 2 == 0:
	print(l)
else:
	d = sorted(c)
	for i in range(len(d)):
		if d[i] % 2 == 1:
			break
	print(l - d[i])


n = int(input())
a = list(map(int, input().split()))
s = int(0)
a.sort()
for i in range(len(a)):
	s += a[i]
if s & 1:
	for i in range(len(a)):
		if a[i] & 1:
			s -= a[i]
			break
print(s)
import time, sys
sys.stderr.write('{0:.3f} ms\n'.format(time.clock() * 1000))


n = int(input())
ls = sorted(list(map(int, input().split())))
while sum(ls) % 2 != 0 and len(ls) > 1:
	for i in range(0, len(ls)):
		if ls[i] % 2:
			ls.pop(i)
			break
if sum(ls) % 2 == 0:
	print(sum(ls))
else:
	print(0)


a = int(input())
p = [int(x) for x in input().split()]
o = []
e = []
for i in p:
	if i % 2 == 0:
		o.append(i)
	else:
		e.append(i)
e.sort(reverse=True)
if len(e) % 2:
	e.pop()
k = sum(e) + sum(o)
print(k)


import sys
import math
n = int(sys.stdin.readline())
a = list(map(lambda x: int(x), sys.stdin.readline().split()))
a.sort(reverse=True)
max_odd = None
acc = 0
for i in range(n):
	if a[i] % 2 != 0:
		if max_odd is None:
			max_odd = a[i]
		else:
			acc += max_odd + a[i]
			max_odd = None
	else:
		acc += a[i]
print(acc)


import sys
n = int(input())
a = [int(i) for i in input().split(' ')]
b = []
c = []
summa = 0
for i in a:
	if int(i) == int(i / 2) * 2:
		b.append(i)
	else:
		c.append(i)
for i in b:
	summa += i
c = sorted(c)
for i in range(int(c.__len__() / 2) * 2):
	summa += c[c.__len__() - i - 1]
print(summa)


n = int(input())
answer = 0
last = 10 ** 9 + 1
inp = input().split()
for i in inp:
	answer += int(i)
	if int(i) % 2 != 0 and int(i) < last:
		last = int(i)
if answer % 2 != 0:
	answer = answer - last
print(answer)


n = int(input())
l = list(map(int, input().split()))
l.sort()
s = sum(l)
if s % 2 == 0:
	print(str(s))
else:
	i = 0
	while l[i] % 2 == 0:
		i += 1
	print(str(s - l[i]))


tnumbers = int(input())
numbers = sorted(list(map(int, input().split())))
jam = sum(numbers)
if jam % 2 == 0:
	print(jam)
else:
	for i in numbers:
		if i % 2 == 1:
			jam -= i
			break
	print(jam)


n = int(input())
elems = list(map(int, input().split()))
even = sum((e for e in elems if e % 2 == 0))
odd = [e for e in elems if e % 2 == 1]
odd.sort()
total = even + sum(odd)
if len(odd) % 2 == 1:
	total -= odd[0]
print(total)


n = int(input())
numbers = sorted(list(map(int, input().split(' '))))
smallest_odd_number = 0
cur_sum = 0
for i in numbers:
	if smallest_odd_number == 0 and i % 2 != 0:
		smallest_odd_number = i
	else:
		cur_sum += i
if cur_sum % 2 != 0:
	cur_sum += smallest_odd_number
print(cur_sum)


a = int(input())
l = list(map(int, input().split()))
if sum(l) % 2 == 0:
	print(sum(l))
else:
	l.sort()
	for i in l:
		if i % 2 != 0:
			print(sum(l) - i)
			break


n = int(input())
a = list(map(int, input().split()))
ans = 0
odd = 0
k = 100000000000
for i in a:
	ans += i
	if i % 2 == 1:
		odd += 1
		k = min(k, i)
if odd % 2 == 1:
	ans -= k
print(ans)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 1:
	s = s - min([i for i in a if i % 2])
print(s)


n = int(input())
nums = [int(x) for x in input().split()]
lo = 1000000001
s = 0
for curr in nums:
	if curr % 2 == 0:
		s += curr
	else:
		lo = min(lo, curr)
		s += curr
if s % 2 == 1:
	s -= lo
print(s)


numi = int(input())
n = input()
n = ' ' + n + ' '
l = []
a = n.find(' ')
while a != len(n) - 1:
	l.append(int(n[a + 1:n.find(' ', a + 1)]))
	a = n.find(' ', a + 1)
l.sort(reverse=True)
cost = 0
for i in range(numi):
	cost = cost + l[i]
	if l[i] % 2 != 0:
		small = l[i]
if cost % 2 == 0:
	print(cost)
else:
	cost = cost - small
	print(cost)


n = int(input())
ns = sorted(map(int, input().split()))
sns = sum(ns)
if sns % 2 == 0:
	print(sns)
else:
	idx = 0
	while ns[idx] % 2 == 0:
		idx += 1
	print(sns - ns[idx])


n = int(input())
l = list(map(int, input().split()))
l.sort()
if sum(l) % 2 == 0:
	print(sum(l))
	exit()
else:
	s = sum(l)
	for i in range(len(l)):
		if l[i] % 2 == 1:
			s -= l[i]
		if s % 2 == 0:
			print(s)
			exit()


n = int(input())
a = [int(x) for x in input().split()]
summ = 0
count = 0
minn = 10000000000000
for i in range(n):
	if a[i] % 2 == 1:
		minn = min(minn, a[i])
		count += 1
if count % 2 == 0:
	print(sum(a))
else:
	print(sum(a) - minn)


n = int(input())
a = list(map(int, input().split()))
minodd = 10000000000
summation = sum(a)
for elem in a:
	if elem % 2 != 0:
		minodd = min(minodd, elem)
if summation % 2 == 0:
	print(summation)
else:
	print(summation - minodd)


import sys
from itertools import *
from cmath import *
input = sys.stdin.readline
from math import *

def inp():
	return int(input().strip())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
arr = inlt()
even = []
odd = []
for el in arr:
	if el % 2 == 0:
		even.append(el)
	else:
		odd.append(el)
sum = 0
for el in even:
	sum += el
odd.sort()
odd.reverse()
if len(odd) % 2 != 0:
	odd.pop()
for el in odd:
	sum += el
print(sum)


t = int(input())
arr = [int(i) for i in input().split()]
us = {1: [], 0: []}
for i in arr:
	us[i % 2].append(i)
us[1].sort()
ans = sum(us[0])
if len(us[1]) % 2 == 0:
	ans += sum(us[1])
else:
	ans += sum(us[1][1:])
print(ans)


a = int(input())
arr = list(map(int, input().split(' ')))
arr.sort()
s = sum(arr)
if s % 2 != 0:
	for i in arr:
		if i % 2 == 1:
			s -= i
			break
print(s)


n = int(input())
a = [int(x) for x in input().split()]
the_sum = sum(a)
if the_sum % 2 == 0:
	print(the_sum)
else:
	max_num = max(a)
	min_odd = max_num + 1
	for aa in a:
		if aa % 2 == 1 and aa < min_odd:
			min_odd = aa
	if min_odd == max_num + 1:
		print(0)
	else:
		print(the_sum - min_odd)


n = int(input())
a = list(map(int, input().split()))
a.sort()
b = sum(a)
if b % 2 == 0:
	print(b)
	exit(0)
else:
	i = 0
	while a[i] % 2 == 0:
		i += 1
print(b - a[i])


from sys import stdin, stdout

def isEven(inum):
	if inum == 0:
		return True
	if inum % 2 == 0:
		return True
	return False

def FindAnswer(iArr):
	if len(iArr) == 1:
		if isEven(iArr[0]):
			return iArr[0]
		else:
			return 0
	resE = list()
	resO = list()
	for iv in iArr:
		if isEven(iv):
			resE.append(iv)
			continue
		resO.append(iv)
	if not isEven(len(resO)):
		resO.pop()
	return sum(resE) + sum(resO)
xn = int(stdin.readline().rstrip())
xArr = list()
xArr = [int(x) for x in stdin.readline().rstrip().split()]
xArr.sort(key=None, reverse=True)
ans = FindAnswer(xArr)
stdout.write(str(ans) + '\n')


n = int(input())
l = list(map(int, input().split()))
lo = [i for i in l if i % 2 != 0]
if len(lo) % 2 == 0:
	print(sum(l))
else:
	l.remove(min(lo))
	print(sum(l))


n = int(input())
a = list(map(int, input().split()))
(max, sum, find) = (0, 0, 0)
for i in range(n):
	sum += a[i]
	if sum % 2 == 0:
		if sum > max:
			max = sum
for i in range(n):
	find = sum - a[i]
	if find % 2 == 0:
		if find > max:
			max = find
print(max)


n = int(input())
b = list(map(int, input().split()))
b = sorted(b)
if sum(b) % 2 == 0:
	print(sum(b))
else:
	for i in b:
		if i % 2 != 0:
			print(sum(b) - i)
			break


numbers = int(input())
lNum = [int(n) for n in input().split()]
(cL, suM) = ([], sum(lNum))
for i in lNum:
	if i % 2 == 0:
		cL += [i]
	if (suM - i) % 2 == 0:
		cL += [suM - i]
	if suM % 2 == 0:
		cL += [suM]
print(max(cL))


n = int(input())
R = lambda : map(int, input().split())
v = list(R())
s = sum(v)
if s % 2 == 0:
	print(s)
else:
	v = sorted(v)
	for x in v:
		if x % 2 == 1:
			print(s - x)
			exit()


n = int(input())
l = list(map(int, input().split()))
s = 0
ol = []
for i in l:
	if i % 2 == 0:
		s = s + i
	else:
		ol.append(i)
if len(ol) % 2 == 0:
	s = s + sum(ol)
else:
	s = s + sum(ol) - min(ol)
print(s)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ans = 0
for i in range(n):
	ans += a[i]
if ans % 2 == 0:
	print(ans)
else:
	for i in range(len(a) - 1, -1, -1):
		if a[i] % 2 != 0:
			ans -= a[i]
			break
	print(ans)


n = int(input())
a = list(map(int, input().split()))
lst = []
for i in a:
	if i % 2 != 0:
		lst.append(i)
lst.sort()
sm = sum(a)
if sm % 2 != 0:
	sm = sm - lst[0]
print(sm)


n = int(input())
a = [int(a) for a in input().split()]
b = sum(a)
c = []
a.sort()
if b % 2 == 0:
	print(b)
elif len(a) == 1:
	print(0)
else:
	for i in range(n):
		if a[i] % 2 != 0:
			b -= a[i]
			break
		else:
			continue
	if b % 2 == 0:
		print(b)
	else:
		print(0)


n = int(input())
nums = [int(x) for x in input().split()]
odds = []
s = 0
l = 0
for x in nums:
	if x % 2 == 0:
		s += x
	else:
		l += 1
		odds.append(x)
if l > 1:
	odds.sort(reverse=True)
	if l % 2 == 0:
		s += sum(odds)
	else:
		s += sum(odds[:l - 1])
print(s)


n = int(input())
mas = sorted(list(map(int, input().split())))
mas1 = []
s = 0
if len(mas) == 1:
	if mas[0] % 2 == 0:
		print(mas[0])
	else:
		print(0)
	exit(0)
if sum(mas) % 2 == 0:
	print(sum(mas))
	exit(0)
for i in range(len(mas)):
	if mas[i] % 2 == 1:
		s += 1
		mas1.append(mas[i])
if s % 2 == 0:
	print(sum(mas))
	exit(0)
print(sum(mas) - mas1[0])


input()
ar = list(map(int, input().split()))
a = []
b = []
for t in ar:
	if t % 2 == 0:
		a.append(t)
	else:
		b.append(t)
b.sort()
if len(b) % 2 != 0:
	b = b[1:]
print(sum(a) + sum(b))


n = int(input())
l = list(map(int, input().split()))
s = 0
p1 = []
for i in range(n):
	if l[i] % 2 == 0:
		s += l[i]
	else:
		p1.append(l[i])
p1.sort(reverse=True)
if len(p1) % 2 == 0:
	s += sum(p1)
else:
	s += sum(p1)
	s -= p1[-1]
print(s)


n = int(input())
a = list(map(int, input().split()))
sum = 0
p = []
for i in range(n):
	if a[i] % 2 == 0:
		sum += a[i]
	else:
		p.append(a[i])
p.sort()
if len(p) % 2 != 0:
	p.pop(0)
for t in range(len(p)):
	sum += p[t]
print(sum)


def minodd(a):
	min = max(a)
	for elem in a:
		if elem % 2 == 1 and elem < min:
			min = elem
	return min
from functools import reduce
n = int(input())
a = [int(i) for i in input().split()]
sum = reduce(lambda x, y: x + y, a)
if sum % 2 == 0:
	print(sum)
else:
	print(sum - minodd(a))


input()
a = list(map(int, input().split()))
s = sum(a)
b = sorted(a, reverse=False)
if s % 2 == 0:
	print(s)
	exit(0)
else:
	for x in b:
		if x % 2 == 1:
			s = s - x
		if s % 2 == 0:
			print(s)
			exit(0)
print(0)


a = int(input())
s = [int(i) for i in input().split()]
ss = sum(s)
s.sort()
if ss % 2 == 0:
	print(ss)
else:
	for i in s:
		if i % 2 != 0:
			ss = ss - i
			print(ss)
			break


n = int(input())
s = list(reversed(sorted(map(int, input().split()))))
odd = 0
small = s[0]
for i in s:
	if i % 2 == 1:
		odd += 1
		if i < small:
			small = i
if odd % 2 == 0:
	print(sum(s))
else:
	print(sum(s) - small)


n = int(input())
a = list(map(int, input().split()))
(odd, even) = (0, 0)
l = []
for i in range(n):
	if a[i] % 2 == 0:
		even = even + 1
	else:
		odd = odd + 1
		l.append(a[i])
if odd % 2 == 0:
	print(sum(a))
else:
	y = min(l)
	print(sum(a) - y)


cases = int(input())
d = input()
x = [int(i) for i in d.split()]
noteven = [i for i in x if i % 2 != 0]
maxSum = sum(x)
if maxSum % 2 == 0:
	print(maxSum)
else:
	print(maxSum - min(noteven))


n = int(input())
x = list(map(int, input().split()))
x.sort()
ans = 0
cnt_odd = 0
odd_min = 10 ** 10
for i in range(n):
	if x[i] % 2 != 0:
		cnt_odd += 1
		if x[i] < odd_min:
			odd_min = x[i]
if cnt_odd % 2 == 0:
	print(sum(x))
else:
	print(sum(x) - odd_min)


n = int(input())
lst = map(int, input().split())
odd = []
ans = 0
tmp = 0
for t in lst:
	if t % 2 == 0:
		ans += t
	else:
		odd.append(t)
odd.sort()
odd.reverse()
for t in odd:
	if tmp > 0:
		ans += tmp + t
		tmp = 0
	else:
		tmp = t
print(ans)


from sys import stdin
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
par = []
impar = []
for i in range(n):
	if s[i] % 2 == 0:
		par.append(s[i])
	else:
		impar.append(s[i])
par.sort()
impar.sort()
x = 0
x = sum(par)
while len(impar) >= 2:
	x += impar[-1] + impar[-2]
	impar.pop()
	impar.pop()
print(x)


n = int(input())
xs = sorted(map(int, input().split()), reverse=True)
s = 0
odd = None
for x in xs:
	if x % 2 == 0:
		s += x
	elif odd is None:
		odd = x
	else:
		s += odd
		s += x
		odd = None
print(s)


a = 0
b = 10 ** 9
c = 0
input()
for _ in map(int, input().split()):
	a += _
	if _ % 2:
		b = min(b, _)
		c += 1
if c % 2:
	a -= b
print(a)


n = int(input())
x = list(map(int, input().split()))
(a, b) = ([], [])
for i in x:
	if i % 2 == 0:
		a.append(i)
	else:
		b.append(i)
b.sort(reverse=True)
l = len(b) // 2 * 2
print(sum(a) + sum(b[:l]))


n = int(input())
vetor = list(map(int, input().split(' ')))
soma = sum(vetor)
vetor.sort()
for i in range(n):
	if soma % 2 == 0:
		break
	if vetor[i] % 2 == 1:
		soma -= vetor[i]
print(soma)


n = int(input())
l = list(map(int, input().split()))
m = []
for i in l:
	if i % 2 != 0:
		m.append(i)
m = sorted(m)
s = sum(l)
if s % 2 != 0:
	print(s - m[0])
else:
	print(s)


n = int(input())
l = list(map(int, input().split()))
s = 0
m = 10 ** 9
for x in l:
	if x % 2 == 1:
		if x < m:
			m = x
	s += x
if s % 2 == 0:
	print(s)
else:
	print(s - m)


n = int(input())
max = 0
odd = 0
numbers = list(map(int, input().split()))
numbers.sort()
for i in range(n - 1, -1, -1):
	m = numbers[i]
	if m % 2 == 0:
		max += m
	elif odd == 0:
		odd = m
	else:
		max += m + odd
		odd = 0
print(max)


n = int(input())
a = list(map(int, input().split()))
if sum(a) % 2 != 0:
	tmp = 10 ** 10
	for i in range(n):
		if a[i] % 2 != 0 and a[i] < tmp:
			tmp = a[i]
	print(sum(a) - tmp)
	quit()
print(sum(a))


n = int(input())
arr = list(map(int, input().split()))
arr = sorted(arr)
s = sum(arr)
if s % 2 == 0:
	print(s)
else:
	c = -1
	for v in arr:
		if v % 2 == 1:
			c = v
			break
	if c == -1:
		print(0)
	else:
		print(s - c)


N = int(input())
a = list(map(int, input().split()))
k = 0
min_nechet = 10 ** 10
for i in a:
	if i % 2 == 1:
		k += 1
		min_nechet = min(min_nechet, i)
if k % 2 == 0:
	print(sum(a))
else:
	print(sum(a) - min_nechet)


n = int(input())
lst = list(map(int, input().rstrip().split()))
summ = sum(lst)
if summ % 2 == 0:
	print(summ)
else:
	lst.sort()
	for i in lst:
		if i % 2 != 0:
			summ -= i
			break
	print(summ)


n = int(input())
N = [int(x) for x in input().split()]
S = sum(N)
odd = [x for x in N if x % 2 == 1]
x = min(odd) if len(odd) > 0 else 0
print(S - x if S % 2 else S)


def fun():
	n = int(input())
	nS = sorted([int(x) for x in input().split()])
	sumN = sum(nS)
	if sumN % 2 == 0:
		print(sumN)
		return
	for i in range(n):
		if (sumN - nS[i]) % 2 == 0:
			print(sumN - nS[i])
			return
	print(0)
fun()


n = int(input())
ip = list(map(int, input().split()))
x = sum(ip)
if x % 2 == 0:
	print(x)
else:
	ip = sorted(ip)
	for j in ip:
		if j % 2 != 0:
			print(x - j)
			break


n = int(input())
sum = 0
nechet = []
numbers = input().split()
for i in numbers:
	if int(i) % 2 == 0:
		sum += int(i)
	else:
		nechet.append(int(i))
if len(nechet) % 2 == 0:
	for num in nechet:
		sum += num
else:
	k = nechet[0]
	for num in nechet:
		if num < k:
			k = num
		sum += num
	sum -= k
print(sum)


n = int(input())
(even, odd) = ([], [])
for num in map(int, input().split(' ')):
	if num % 2:
		odd.append(num)
	else:
		even.append(num)
ans = sum(even) + sum(odd)
if len(odd) % 2:
	ans = ans - min(odd)
print(ans)


input()
l = list(map(int, input().split()))
l = sorted(l)
s = sum(l)
if s % 2 != 0:
	for i in l:
		if i % 2 != 0:
			s = s - i
			break
print(s)


(n, a) = (int(input()), list(map(int, input().split())))
o = [x for x in a if x % 2]
print(sum(a) - (min(o) if len(o) % 2 else 0))


input()
m = 2 * 10 ** 9
s = 0
for x in map(int, input().strip().split(' ')):
	if x % 2 != 0:
		m = min(m, x)
	s += x
print(s if s % 2 == 0 else s - m)


n = int(input())
nums = [int(s) for s in input().split()]
odd = []
even = []
for elem in nums:
	if elem % 2 == 0:
		even.append(elem)
	else:
		odd.append(elem)
odd.sort(reverse=True)
even.sort(reverse=True)
if len(odd) % 2 != 0:
	print(sum(even) + sum(odd[:-1]))
else:
	print(sum(even) + sum(odd))


n = int(input())
l = [int(i) for i in input().split()]
l.sort()
if sum(l) % 2 == 0:
	print(sum(l))
else:
	m = 0
	for i in range(n):
		if l[i] % 2 == 1:
			m = l[i]
			break
	print(sum(l) - m)


n = int(input())
l = [int(x) for x in input().split()]
odd = list(filter(lambda x: x % 2 != 0, l))
odd.sort(reverse=True)
even = list(filter(lambda x: x % 2 == 0, l))
sum1 = sum(even)
if len(odd) % 2 == 0:
	sum1 += sum(odd)
else:
	sum1 += sum(odd[:len(odd) - 1])
print(sum1)


def main():
	n = int(input())
	l = [int(x) for x in input().split()]
	print(solver(l))

def solver(l):
	odds = 0
	smallestOdd = None
	total = 0
	for x in l:
		if x > 0:
			total += x
			if x % 2 != 0:
				odds += 1
				if smallestOdd == None or x < smallestOdd:
					smallestOdd = x
	if odds % 2 != 0:
		total -= smallestOdd
	return total
main()


n = int(input())
a = list(map(int, input().split()))
s = 0
c = 0
b = []
for i in range(len(a)):
	if a[i] % 2 != 0:
		c += 1
		b.append(a[i])
	else:
		s = s + a[i]
b.sort()
if c % 2 == 0:
	for i in range(len(b)):
		s = s + b[i]
else:
	for i in range(1, len(b)):
		s = s + b[i]
print(s)


n = input()
arr = list(map(int, input().split()))
arr.sort()
ans = 0
odd = 0
i = int()
for i in arr:
	if i % 2 == 1:
		odd = odd + 1
if odd % 2 == 0:
	for i in arr:
		ans = ans + i
	print(ans)
elif odd % 2 == 1:
	d = 0
	for i in arr:
		if i % 2 == 1:
			if d >= 1:
				ans = ans + i
			else:
				d = d + 1
		else:
			ans = ans + i
		i = i + 1
	print(ans)


n = int(input())
a = list(map(int, input().split()))
even_numbers = []
odd_numbers = []
x = 0
if a == [0]:
	print(0)
else:
	for i in a:
		if i % 2 == 0:
			even_numbers.append(i)
		elif i % 2 == 1:
			odd_numbers.append(i)
	if len(odd_numbers) % 2 == 1:
		m = min(odd_numbers)
		odd_numbers.remove(m)
		s = even_numbers + odd_numbers
	else:
		s = even_numbers + odd_numbers
for i in s:
	x += i
print(x)


n = int(input())
a = list(map(int, input().split()))
a.sort()
b = 0
c = 0
for i in range(n):
	if a[i] % 2 == 1:
		if b == 0:
			b = a[i]
		c += 1
print(sum(a) - b * (c % 2))


n = int(input())
line = list(map(int, input().split()))
if sum(line) % 2 == 0:
	print(sum(line))
else:
	line = sorted(line)
	for el in line:
		if el % 2:
			print(sum(line) - el)
			break


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
temp = sum(arr)
if temp % 2 == 0:
	print(temp)
else:
	for i in range(n):
		if arr[i] % 2 != 0:
			print(temp - arr[i])
			break


n = int(input())
a = list(map(int, input().split()))
res = count = 0
odd = []
for num in a:
	if num % 2 == 0:
		res += num
	else:
		count += 1
		odd.append(num)
odd.sort()
if count % 2 == 0:
	print(res + sum(odd))
else:
	print(res + sum(odd[1:]))


n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
p = k = l = 0
for i in a:
	if i % 2 == 0:
		p += i
	else:
		p += i
		l += 1
		k = i
print(p - k if l % 2 != 0 else p)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
print(sum(a) - min((b for b in a if b % 2)) if s % 2 else sum(a))


n = int(input())
daf = list(map(int, input().split()))
gan = []
gen = []
for x in daf:
	if x % 2:
		gan.append(x)
if len(gan) == 0:
	print(sum(daf))
else:
	print(sum(daf) - min(gan) * (len(gan) % 2))


n = int(input())
integer = [int(x) for x in input().split()]
integer.sort()
s = sum(integer)
if s % 2 == 1:
	for num in integer:
		if num % 2 == 1:
			s -= num
			break
print(s)


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
a.reverse()
s = 0
m = 0
c = 0
for i in range(n):
	s += a[i]
	if a[i] % 2 == 1:
		c += 1
		m = a[i]
if c % 2 == 1:
	s -= m
print(s)


n = int(input())
L = list(map(int, input().split()))
if sum(L) % 2 == 0:
	print(sum(L))
else:
	k = sum(L)
	L.sort()
	index = 0
	while L[index] % 2 == 0:
		index += 1
	print(k - L[index])


input()
numbers = sorted(list(map(int, input().split())))
f = list(filter(lambda x: x % 2 != 0, numbers))
s = sum(numbers)
print(s if s % 2 == 0 else s - f[0])


n = int(input())
l = [int(s) for s in input().split()]
l.sort()
c = 0
for i in l:
	if i % 2 != 0:
		c += 1
if c % 2 == 0:
	print(sum(l))
else:
	for i in l:
		if i % 2 != 0:
			print(sum(l) - i)
			break


n = input()
l = list(map(int, input().split()))
if sum(l) % 2 == 0:
	print(sum(l))
else:
	s = [x for x in l if x % 2 != 0]
	print(sum(l) - min(s))


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
lens = read_int()
elem = read_ints()
(odds, min_odd, sums) = (0, max_val, 0)
for i in elem:
	sums += i
	if i % 2:
		odds = 1 - odds
		min_odd = min(min_odd, i)
print(sums - odds * min_odd)


n = int(input())
nums = list(map(int, input().split(' ')))
nums.sort()
odd = []
even = [0]
for i in range(0, n, 1):
	if nums[i] % 2 == 0:
		even.append(nums[i])
	elif nums[i] % 2 != 0:
		odd.append(nums[i])
	else:
		pass
result = 0
result += sum(even)
if len(odd) % 2 == 0:
	result += sum(odd)
elif len(odd) % 2 != 0:
	odd.remove(odd[0])
	result += sum(odd)
print(result)


input()
numbers = input().split()
evens = []
odds = []
for number in numbers:
	n = int(number)
	evens.append(n) if n % 2 == 0 else odds.append(n)
result = sum(evens)
if len(odds) % 2 == 0:
	result += sum(odds)
elif len(odds) > 1:
	odds.sort()
	result += sum(odds[1:])
print(result)


n = int(input())
nums = sorted(list(map(int, input().split())))
res = sum(nums)
odds = [x for x in nums if x % 2 == 1]
if len(odds) % 2 == 0:
	print(res)
else:
	print(res - odds[0])


n = int(input())
a = input()
A = []
for i in a.split():
	A.append(int(i))
Sum = sum(A)
A.sort(reverse=True)
if Sum % 2 == 0:
	print(Sum)
else:
	for j in range(1, n + 1):
		if A[-1 * j] % 2 != 0:
			Sum = Sum - A[-1 * j]
			break
	print(Sum)


n = int(input())
a = list(map(int, input().split(' ')))
a.sort(reverse=True)
t = -1
c = 0
for x in a:
	if x % 2 == 0:
		c += x
	elif t < 0:
		t = x
	else:
		c += t + x
		t = -1
print(c)


n = int(input())
IntStr = sorted([int(x) for x in input().split()])
StrSum = sum(IntStr)
NewSum = 0
if StrSum % 2 != 0:
	for j in range(1, n + 1):
		for i in range(n + 1 - j):
			NewSum = StrSum - sum(IntStr[i:i + j])
			if NewSum % 2 == 0:
				StrSum = NewSum
				break
		if NewSum % 2 == 0:
			break
print(StrSum)


x = eval(input())
sum = 0
y = 0
i = 0
y = [int(x) for x in input().split()]
while i < x:
	sum = sum + y[i]
	i += 1
if sum % 2 == 1:
	i = 0
	minOdd = 1000000000
	while i < x:
		if y[i] < minOdd and y[i] % 2 == 1:
			minOdd = y[i]
		i += 1
	sum -= minOdd
print(sum)


n = int(input())
a = sorted(list(map(int, input().split())))[::-1]
t = r = 0
for x in a:
	if x % 2:
		if t:
			r += t + x
			t = 0
		else:
			t = x
	else:
		r += x
print(r)


n = int(input())
even = []
odd = []
l = list(map(int, input().split()))
for i in range(n):
	if l[i] % 2 == 0:
		even.append(l[i])
	else:
		odd.append(l[i])
sum_even = sum(even)
odd.sort()
if len(odd) % 2 == 0:
	sum_even = sum_even + sum(odd)
else:
	sum_even = sum_even + sum(odd[1:])
print(sum_even)


n = int(input())
(*a,) = map(int, input().split())
print(sum(a) - min((i for i in a if i % 2)) if sum(a) % 2 else sum(a))


n = int(input())
nums = list(map(int, input().split()))
total = sum(nums)
if total % 2 == 0:
	print(total)
	quit()
else:
	minim = 1000000001
	for i in range(n):
		if nums[i] % 2 != 0:
			minim = min(minim, nums[i])
	print(total - minim)


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
if s % 2 == 0:
	print(s)
else:
	m = 1e+20
	for i in arr:
		if i % 2 == 1 and i < m:
			m = i
	print(s - m)


n = int(input())
li = list(map(int, input().split()))
if sum(li) % 2 == 0:
	print(sum(li))
	exit()
mn = 10000000000
for i in li:
	if i % 2 == 1:
		mn = min(mn, i)
print(sum(li) - mn)


a = input()
x = [int(x) for x in input().split()]
x.sort()
if sum(x) % 2 == 0:
	print(sum(x))
else:
	for i in x:
		if i % 2 != 0:
			print(sum(x) - i)
			break


n = int(input())
d = list(map(int, input().split()))
d.sort(reverse=True)
x = []
summ = 0
for i in d:
	if i % 2 == 0:
		summ += i
	elif len(x) == 0:
		x.append(i)
	else:
		summ += x[0] + i
		x = []
print(summ)


n = int(input())
oddl = []
evenl = []
s = input()
sl = s.split()
for i in range(0, n):
	x = int(sl[i])
	if x % 2 == 0:
		evenl.append(x)
	else:
		oddl.append(x)
if len(oddl) % 2 == 0:
	print(sum(oddl) + sum(evenl))
else:
	minx = oddl[0]
	for i in range(1, len(oddl)):
		if minx > oddl[i]:
			minx = oddl[i]
	print(sum(oddl) + sum(evenl) - minx)


n = int(input())
a = list(map(int, input().split(' ')))
s = sum(a)
if s % 2 == 0:
	print(s)
	exit(0)
m = 10 ** 9
for i in a:
	m = min(m, m if i % 2 == 0 else i)
print(s - m)


n = int(input())
arr = [int(x) for x in input().split()]
arr = sorted(arr)
odd = 0
for i in arr:
	if i % 2 == 1:
		odd += 1
if odd % 2 == 1:
	for i in range(n):
		if arr[i] % 2 == 1:
			del arr[i]
			break
print(sum(arr))


n = int(input())
s = list(map(int, input().split()))
min_nechet = max(s)
for i in range(n):
	if s[i] % 2 != 0:
		min_nechet = min(s[i], min_nechet)
sum_s = sum(s)
if sum(s) % 2 != 0:
	sum_s = sum(s) - min_nechet
print(sum_s)


def solve(array):
	odds = 0
	evens = 0
	x = sum(array)
	if x % 2 == 0:
		return x
	odds = []
	for i in array:
		if i % 2 != 0:
			odds.append(i)
	minimum = min(odds)
	return x - minimum
x = input()
array = list(map(int, input().split()))
print(solve(array))


from collections import deque
from math import log

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())
n = ii()
s = 0
a = li()
x = 1000000000.0 + 5
c = 0
for i in range(n):
	if a[i] % 2:
		x = min(x, a[i])
		c += 1
if c % 2:
	print(sum(a) - x)
else:
	print(sum(a))


n = int(input())
a = list(map(int, input().split()))
evens = list()
odds = list()
for x in a:
	if x % 2 == 0:
		evens.append(x)
	else:
		odds.append(x)
ret = sum(evens)
odds.sort()
i = len(odds) - 1
while i - 1 >= 0:
	ret += odds[i] + odds[i - 1]
	i -= 2
print(ret)


no_of_integers = int(input())
arr = list(map(int, input().split(' ')))
(evens, odds) = ([], [])
for i in arr:
	if i % 2 == 0:
		evens.append(i)
	else:
		odds.append(i)
if len(odds) % 2 != 0:
	odds.remove(min(odds))
print(sum(odds) + sum(evens))


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	A = read_ints()
	SUM = sum(A)
	odd = 0
	MIN = float('inf')
	for a in A:
		if is_odd(a):
			odd += 1
			MIN = min(MIN, a)
	if odd % 2:
		SUM -= MIN
	print(SUM)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		debug(n, i)
		if n % i == 0:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


n = int(input())
a = [int(x) for x in input().split()]
min_odd = None
for num in a:
	if num % 2 == 1 and (min_odd is None or num < min_odd):
		min_odd = num
s = sum(a)
if s % 2 == 1:
	s -= min_odd
print(s)


n = int(input())
mas = list(map(int, input().split()))
minNech = 10 ** 9
kol = 0
s = 0
for i in mas:
	if i % 2 != 0:
		minNech = min(minNech, i)
		kol += 1
	s += i
if kol % 2 != 0:
	s -= minNech
print(s)


n = int(input())
total = 0
odd = []
nums = [int(x) for x in input().split()]
for num in nums:
	total += num
	if num % 2 == 1:
		odd.append(num)
if len(odd) % 2 == 1:
	total -= min(odd)
print(total)


n = int(input())
a = list(map(int, input().split()))
(b, s) = ([], 0)
for x in a:
	if x % 2:
		b.append(x)
	else:
		s += x
b.sort()
print(s + sum(b[len(b) & 1:]))


n = int(input())
number = list(map(int, input().split()))
sm = 0
odd = []
for i in number:
	if i % 2 == 0:
		sm += i
	else:
		odd.append(i)
if len(odd) % 2 == 0:
	print(sum(odd) + sm)
else:
	odd.sort()
	print(sum(odd[1:]) + sm)


n = input()
l = sorted(map(int, input().split()), reverse=True)
even = [x for x in l if not x % 2]
odd = [x for x in l if x % 2]
print(sum(even) + sum(odd[:len(odd) - len(odd) % 2]))


n = int(input())
min = 10 ** 9
S = 0
i = 0
ch = input()
d = ch.split(' ')
for c in d:
	x = int(c)
	S = S + x
	if x % 2 != 0 and x < min:
		min = x
if S % 2 != 0:
	S = S - min
print(S)


n = int(input())
a = list(map(int, input().split()))
odd = []
even = []
for i in a:
	if i % 2 == 0:
		even.append(i)
	else:
		odd.append(i)
if len(odd) % 2 == 0:
	x = sum(odd)
else:
	odd.sort()
	odd.reverse()
	x = sum(odd[:len(odd) - 1])
x += sum(even)
print(x)


def read():
	return [int(x) for x in input().split()]
notimportant = int(input()[0])
x = read()
s = 0
i = 0
while i < len(x):
	if x[i] % 2 == 0:
		s += x.pop(i)
	else:
		i += 1
if len(x) % 2 == 0:
	s += sum(x)
else:
	x.pop(x.index(min(x)))
	s += sum(x)
print(s)


input()
x = list(map(int, input().split()))
nc = [a for a in x if a % 2 == 1]
if len(nc) == 0:
	print(sum(x))
	exit(0)
print(sum(x) - min(nc) * (len(nc) % 2))


_ = input()
l = tuple(map(int, input().split()))
ev = []
od = []
for i in l:
	if i % 2 == 0:
		ev.append(i)
	else:
		od.append(i)
result = sum(ev)
result += sum(sorted(od)[len(od) % 2:])
print(result)


N = int(input())
L = []
sumRes = 0
L = input().split(' ')
for i in range(N):
	L[i] = int(L[i])
	sumRes = sumRes + L[i]
L.sort()
i = 0
while True:
	if sumRes % 2 == 0:
		break
	if L[i] % 2 == 1:
		sumRes = sumRes - L[i]
	i = i + 1
print(sumRes)


n = int(input())
total_sum = 0
odd = []
num = list(map(int, input().split()))
for i in num:
	total_sum += i
	if i & 1 == 1:
		odd.append(i)
odd.sort()
if total_sum & 1 == 1:
	total_sum -= odd[0]
print(total_sum)


n = int(input())
numOdd = 0
minOdd = 99999999999
s = 0
l = input().split(' ')
for i in range(n):
	a = int(l[i])
	if a % 2 == 1:
		minOdd = min(minOdd, a)
		numOdd += 1
	s += a
if numOdd % 2 == 0:
	print(s)
else:
	print(s - minOdd)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	cmin = 10 ** 9 + 1
	for c in a:
		if c % 2 == 1 and c < cmin:
			cmin = c
	s -= cmin
	print(s)


n = int(input())
a = list(map(int, input().split()))
(a, s) = (sorted(a), sum(a))
if s % 2 == 0:
	print(s)
else:
	for i in range(0, n):
		if a[i] % 2 == 1:
			print(s - a[i])
			break


n = int(input())
L = list(map(int, input().split(' ')))
s = 0
p = []
im = []
L.sort(reverse=True)
if L[0] % 2 == 0:
	p.append(L[0])
else:
	im.append(L[0])
for i in L[1:]:
	if i % 2 == 0:
		if len(p) != 0:
			s = s + i + p[0]
			p.clear()
		else:
			p.append(i)
	elif len(im) != 0:
		s = s + i + im[0]
		im.clear()
	else:
		im.append(i)
if len(p) != 0:
	s = s + p[0]
print(s)


n = int(input())
nums = [int(i) for i in input().split()]
even = []
odd = []
for i in nums:
	if i % 2 == 0:
		even.append(i)
	else:
		odd.append(i)
odd.sort(reverse=True)
m = len(odd)
if m % 2 == 1:
	odd.pop(m - 1)
S = sum(odd + even)
print(S)


n = int(input())
a = sorted(map(int, input().split()))
b = [0] * len(a)
k = l = 0
if sum(a) % 2 != 0:
	for i in a:
		if i % 2 != 0:
			b[l] = i
			l += 1
		else:
			k += i
	for i in range(1, len(b)):
		k += b[i]
	print(k)
else:
	print(sum(a))


n_int = int(input())
num_list = input().split()
sum_ = 0
min_odd = 1000000000
for i in range(n_int):
	num = int(num_list[i])
	sum_ += num
	if num % 2 != 0:
		min_odd = min(min_odd, num)
if sum_ % 2 != 0:
	sum_ -= min_odd
print(sum_)


n = int(input())
nums = [k for k in map(int, input().split())]
min_odd = 10 ** 9 + 1
for k in nums:
	if k % 2 != 0:
		min_odd = min(min_odd, k)
summ = sum(nums)
if summ % 2 != 0:
	print(summ - min_odd)
else:
	print(summ)


a = int(input())
mn = 0
sm = 0
t = 0
v = list(map(int, input().split(' ')))
for i in v:
	if i % 2 == 1:
		if t == 0:
			mn = i
		if i < mn:
			mn = i
		t += 1
	sm += i
if t % 2 == 1:
	sm -= mn
print(sm)


n = int(input())
numbers = [int(i) for i in input().split(' ')]
odds = [i for i in numbers if i % 2 == 1]
if len(odds) % 2 == 0:
	print(sum(numbers))
else:
	print(sum(numbers) - min(odds))


n = int(input())
L = list(map(int, input().split()))
I = []
for i in range(n):
	if L[i] % 2:
		I += [L[i]]
if len(I) % 2:
	print(sum(L) - min(I))
else:
	print(sum(L))


n = input()
a = list(map(int, input().split()))
a = sorted(a)
if sum(a) % 2 == 0:
	print(sum(a))
else:
	i = 0
	while a[i] % 2 == 0:
		i += 1
	print(sum(a) - a[i])


n = int(input())
a = list(map(int, input().split()))
a.sort()
sume = 0
for i in range(n):
	sume += a[i]
if sume % 2 == 0:
	print(sume)
else:
	for i in range(n):
		if a[i] % 2 == 1:
			sume -= a[i]
			break
	print(sume)


input()
o = []
s = 0
for i in map(int, input().split()):
	if i % 2:
		o.append(i)
	else:
		s += i
o.sort(reverse=True)
for i in range(len(o) - len(o) % 2):
	s += o[i]
print(s)


n = int(input())
val = list(map(int, input().split()))
sub = sum(val)
total = sum(val)
for i in range(n):
	if val[i] % 2 != 0:
		sub = min(sub, val[i])
if total % 2 == 0:
	print(total)
else:
	print(total - sub)


leng = int(input())
x = input().split()
sum = 0
A = []
for i in range(leng):
	x[i] = int(x[i])
	sum += x[i]
	if x[i] % 2 != 0:
		A.append(x[i])
if len(A) != 0:
	mini = min(A)
if sum % 2 == 0:
	print(sum)
else:
	print(sum - mini)


n = int(input())
z = list(map(int, input().split()))
z.sort()
ganjil = []
genap = []
for i in z:
	if i % 2 == 0:
		genap.append(i)
	else:
		ganjil.append(i)
if len(ganjil) % 2 == 0:
	print(sum(ganjil) + sum(genap))
else:
	print(sum(ganjil) + sum(genap) - ganjil[0])


n = int(input())
l = list(map(int, input().split()))
o = []
e = []
for i in l:
	if i % 2 == 0:
		e.append(i)
	else:
		o.append(i)
if len(o) % 2 == 0:
	print(sum(l))
else:
	s = 0
	o.sort()
	s = s + sum(o[1:]) + sum(e[0:])
	print(s)


n = int(input())
arr = list(map(int, input().strip().split(' ')))
c = []
c = list(filter(lambda x: x % 2 != 0, arr))
a = list(filter(lambda x: x % 2 == 0, arr))
sum1 = 0
sum1 += sum(a)
if len(c) % 2 == 0:
	sum1 += sum(c)
else:
	c = sorted(c)
	sum1 += sum(c)
	sum1 -= c[0]
print(sum1)


n = int(input())
g = []
k = []
for i in range(n):
	a = map(int, input().split())
	g += a
	break
c = sum(g)
for j in g:
	if j % 2 != 0:
		k.append(j)
for u in g:
	if c % 2 == 0:
		break
	elif c % 2 != 0:
		c = c - min(k)
		g.remove(min(k))
print(c)


x = int(input())
p = sorted(list(map(int, input().split())))
while sum(p) % 2 != 0:
	for i in p:
		if i % 2 != 0:
			p.pop(p.index(i))
			break
print(sum(p))


n = int(input())
l = list(map(int, input().split()))
l.sort()
s = sum(l)
while s % 2 > 0:
	i = 0
	while l[i] % 2 == 0:
		i += 1
	s -= l[i]
print(s)


n = int(input())
li = list(map(int, input().split()))
so = sorted(li)
ad = sum(li)
if ad % 2 > 0:
	for i in range(n):
		if so[i] % 2 > 0:
			ad -= so[i]
			break
	print(ad)
else:
	print(ad)


int(input())
even = odd = []
min = sum = 0
for i in str(input()).split():
	sum += int(i)
	if int(i) % 2 == 0:
		even += [int(i)]
	else:
		min = int(i) if min == 0 else int(i) if min > int(i) else min
		odd += [int(i)]
print(sum if sum % 2 == 0 else sum - min)


number_count = int(input())
numbers = [int(x) for x in input().split()]
min_odd = min((x for x in numbers if x % 2 != 0), default=0)
sum_numbers = sum(numbers)
if sum_numbers % 2 != 0:
	sum_numbers -= min_odd
print(sum_numbers)


n = int(input())
l = list(map(int, input().split()))
k = []
sums = 0
for i in range(n):
	if l[i] % 2 == 0:
		sums += l[i]
	else:
		k.append(l[i])
if len(k) > 0:
	if len(k) % 2 == 0:
		sums += sum(k)
	else:
		k.sort()
		sums += sum(k) - k[0]
print(sums)


n = int(input())
a = list(map(int, input().split()))
mina = 1000000000.0
if sum(a) % 2:
	for i in range(n):
		if a[i] % 2:
			mina = min(mina, a[i])
	print(sum(a) - mina)
else:
	print(sum(a))


n = int(input())
s = input()
s = s.split()
odd = []
even = []
for i in s:
	if int(i) % 2 == 0:
		even.append(int(i))
	else:
		odd.append(int(i))
ans = sum(even)
if len(odd) % 2 == 0:
	ans += sum(odd)
else:
	odd.sort()
	ans += sum(odd[1:])
print(ans)


n = int(input())
l = list(map(int, input().split()))
s = 0
odd = 0
for i in l:
	if i % 2 == 1:
		odd += 1
if odd % 2 == 0:
	print(sum(l))
else:
	l.sort()
	l = l[::-1]
	for i in l:
		if i % 2 == 0:
			s += i
		if i % 2 == 1 and odd > 1:
			odd -= 1
			s += i
	print(s)


def f(x):
	if x < 0:
		return 0
	return x
n = int(input())
A = list(map(int, input().split()))
C = 1000000001
D = -C
for elem in A:
	if elem % 2 == 1:
		if elem > 0:
			C = min(C, elem)
		if elem < 0:
			D = max(D, elem)
B = list(map(f, A))
ans = sum(B)
if ans % 2 == 0:
	print(ans)
else:
	print(max(ans - C, ans + D, 0))


from sys import stdin
stdin.readline()
nums = list(map(int, stdin.readline().rstrip().split(' ')))
mi = float('inf')
total = 0
odds = 0
for num in nums:
	if num % 2 == 1:
		odds += 1
		mi = min(num, mi)
	total += num
if odds % 2 == 1:
	total -= mi
print(total)


num = int(input())
numbers = list(map(int, input().split()))
total = 0
for n in numbers:
	total += n
if total % 2 == 0:
	print(str(total))
else:
	numbers = sorted(numbers)
	for n in numbers:
		if n % 2 != 0:
			total -= n
			print(str(total))
			break


n = int(input())
a = list(map(int, input().split()))
a.sort()
odd = []
even = []
for i in range(n):
	if a[i] % 2 == 0:
		even += [a[i]]
	else:
		odd += [a[i]]
m = len(odd)
if m % 2 == 1:
	print(sum(even) + sum(odd[1:]))
else:
	print(sum(even) + sum(odd))


n = int(input())
a = list(map(int, input().split()))
chet = []
ne_chet = []
for i in range(len(a)):
	if a[i] % 2 == 0:
		chet.append(a[i])
	else:
		ne_chet.append(a[i])
sum_chet = sum(chet)
ne_chet.sort()
if len(ne_chet) % 2 == 0:
	sum_ne_chet = sum(ne_chet)
else:
	sum_ne_chet = sum(ne_chet[1:])
print(sum_chet + sum_ne_chet)


input()
D = list(map(int, input().split()))
print(sum(D) - (min((i for i in D if i % 2)) if sum((i for i in D if i % 2)) % 2 == 1 else 0))


n = int(input())
answer = 0
integers = list(map(int, input().split()))
i = 0
while i < n:
	if integers[i] % 2 == 0:
		answer += integers[i]
		del integers[i]
		n -= 1
	else:
		i += 1
if len(integers) % 2 == 0:
	answer += sum(integers)
else:
	answer += sum(sorted(integers)[1:])
print(answer)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 0:
	print(s)
	exit()
else:
	a.sort()
	for i in a:
		if i % 2 == 1:
			print(s - i)
			exit()


inp = input()
l = sorted(list(map(int, input().split())))
p = sum(l)
if p % 2 == 0:
	print(p)
else:
	for num in l:
		if (p - num) % 2 == 0:
			print(p - num)
			break


import sys
a = sys.stdin.readline()
b = sys.stdin.readline()
b = b.strip().split(' ')
total = 0
countOdd = 0
oddMin = sys.maxsize
for i in range(len(b)):
	b[i] = int(b[i])
	if b[i] % 2 == 0:
		total += b[i]
	else:
		countOdd += 1
		if b[i] < oddMin:
			if countOdd == 1:
				none = 1
			else:
				total += oddMin
			oddMin = b[i]
		else:
			total += b[i]
if countOdd % 2 == 0 and countOdd != 0:
	total += oddMin
sys.stdout.write(str(total))


input()
data = list(map(int, input().split()))
res = sum(data)
if res % 2 == 0:
	print(res)
else:
	print(res - min(filter(lambda v: v % 2, data)))


n = int(input())
inp = list(map(int, input().split()))
sm = 0
mn = 100000000000000000
for i in inp:
	if i % 2:
		mn = min(i, mn)
	sm += i
if sm % 2:
	sm -= mn
print(sm)


n = int(input())
st = []
st_Zoj = []
st_Fard = []
ans = 0
for a in map(int, input().split()):
	st.append(a)
st.sort()
for i in range(len(st)):
	if st[i] % 2 is 0:
		st_Zoj.append(st[i])
	else:
		st_Fard.append(st[i])
for i in range(len(st_Zoj)):
	ans += st_Zoj[i]
if len(st_Fard) % 2 is 0:
	for i in range(len(st_Fard)):
		ans += st_Fard[i]
else:
	for i in range(1, len(st_Fard)):
		ans += st_Fard[i]
print(ans)


n = int(input())
num = input()
a = []

def get_the_data(count, num, arr):
	for i in range(0, len(num)):
		if num[i] == ' ':
			arr.append(int(num[count:i]))
			count = i + 1
		elif i == len(num) - 1:
			arr.append(int(num[count:len(num)]))
	return arr
arr = get_the_data(0, num, a)
arr.sort()
odd = 0
even = 0
for i in arr:
	if i % 2 == 1:
		odd += 1
	else:
		even += 1
summed = 0
if odd % 2 == 1:
	for i in range(len(arr)):
		if arr[i] % 2 == 1:
			arr = arr[0:i] + arr[i + 1:len(arr)]
			break
for i in arr:
	summed += i
print(summed)


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
o = 0
for i in range(n):
	if a[i] % 2 != 0:
		o += 1
if o % 2 == 0:
	lim = o
else:
	lim = o - 1
s = 0
for i in range(n):
	if a[i] % 2 != 0 and lim > 0:
		s += a[i]
		lim = lim - 1
	elif a[i] % 2 == 0:
		s += a[i]
print(s)


input()
nums = list((i for i in map(int, input().split())))
print(sum(nums) if sum(nums) % 2 == 0 else sum(nums) - min((i for i in nums if i % 2 != 0)))


input()
a = [*map(int, input().split())]
(s, o, m) = (sum(a), sum((x % 2 for x in a)), min([x for x in a if x % 2], default=0))
print(s - o % 2 * m)


import sys
import math
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
n = int(input())
arr = int_array()
arr.sort()
if sum(arr) % 2 == 0:
	print(sum(arr))
else:
	for i in range(n):
		if arr[i] % 2 != 0:
			arr.pop(i)
			break
	print(sum(arr))


n = int(input())
l = list(map(int, input().split()))
x = sum(l)
if x % 2 == 0:
	print(x)
else:
	l.sort()
	for j in range(n):
		if (x - l[j]) % 2 == 0:
			print(x - l[j])
			break


n = int(input())
a = [int(i) for i in input().split()]
min_a = 1000000001
sum_a = 0
for i in a:
	sum_a += i
	if i % 2 != 0:
		min_a = min(min_a, i)
if sum_a % 2 != 0:
	sum_a -= min_a
print(sum_a)


n = int(input())
l = list(map(int, input().split()))
modd = 1 * 10 ** 9
sum = sum(l)
for i in range(n):
	if l[i] % 2 != 0 and l[i] < modd:
		modd = l[i]
if sum % 2 == 0:
	print(sum)
else:
	print(sum - modd)


n = int(input())
l_n = list(map(int, input().split()))
l_n.sort()
s = 0
n_o = 0
l_o = -1
for i in range(len(l_n)):
	s += l_n[len(l_n) - 1 - i]
	if l_n[len(l_n) - 1 - i] % 2 == 1:
		l_o = l_n[len(l_n) - 1 - i]
		n_o += 1
if n_o % 2 == 1:
	print(s - l_o)
else:
	print(s)


n = int(input())
numbers = list(map(int, input().split()))
s = sum(numbers)
print(s - min((i for i in numbers if i % 2)) if s % 2 else s)


n = int(input())
lst = list(map(int, input().split()))
s = 0
cnt = 0
lst.sort()
for i in lst:
	if i % 2 == 0:
		s += i
	else:
		s += i
		cnt += 1
if cnt % 2 == 0:
	print(s)
else:
	for i in range(n):
		if lst[i] % 2 == 1:
			s -= lst[i]
			break
	print(s)


from sys import stdin
n = int(stdin.readline())
nums = list(map(int, stdin.readline().rstrip().split(' ')))
odds = []
evens = []
s = 0
for num in nums:
	if num % 2 == 0:
		evens.append(num)
		s += num
	else:
		odds.append(num)
odds.sort(reverse=True)
if len(odds) % 2 == 0:
	s += sum(odds)
else:
	s += sum(odds[0:len(odds) - 1])
print(s)


import sys
_ = sys.stdin.readline()
numbers = list(map(int, sys.stdin.readline().split()))
numbers.sort()
s = sum(numbers)
if s % 2 == 1:
	s -= next((n for n in numbers if n % 2 == 1))
print(s)


stack = []
n = int(input())
tup = tuple(map(int, input().split(' ')))
Sum = 0
for i in range(n):
	if tup[i] % 2 == 0:
		Sum += tup[i]
	else:
		stack.append(tup[i])
stack.sort()
if len(stack) % 2 == 0:
	Sum += sum(stack)
else:
	Sum += sum(stack[1:])
print(Sum)


n = input()
a = [int(i) for i in input().split()]
ma = [i for i in a if i % 2 == 1]
sm = sum(a)
if sm % 2 != 0:
	sm = sm - min(ma)
print(sm)


import sys
input = sys.stdin.buffer.readline
n = int(input())
arr = list(map(int, input().split()))
odd = list(filter(lambda x: x % 2 == 1, arr))
odd.sort()
ans = sum(arr)
if ans % 2 == 0:
	print(ans)
else:
	print(ans - odd[0])


n = eval(input())
l = list(map(int, input().split()))
d = []
sum = 0
i = 0
while i < n:
	if l[i] % 2 == 0:
		sum += l[i]
	else:
		d.append(l[i])
	i += 1
if len(d) % 2 == 1:
	i = 0
	min = d[0]
	while i < len(d) - 1:
		if min > d[i + 1]:
			min = d[i + 1]
		i += 1
	sum = sum - min
i = 0
while i < len(d):
	sum += d[i]
	i += 1
print(sum)


n = input()
sLine = input()
sSplit = sLine.split()
v = []
nSum = 0
for s in sSplit:
	nVal = int(s)
	v.append(nVal)
	nSum += nVal
if nSum % 2 == 0:
	print(nSum)
else:
	v.sort()
	for i in v:
		if i % 2 == 1:
			print(nSum - i)
			exit()
	else:
		pass


n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
new_odd = list(filter(lambda x: x % 2 != 0, l))
max_output = 0
if len(new_odd) % 2 != 0:
	num = len(new_odd) - 1
else:
	num = len(new_odd)
for i in l:
	if i % 2 == 0:
		max_output += i
	elif num > 0:
		max_output += i
		num -= 1
print(max_output)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
l1 = sorted([i for i in l if i % 2 == 1])
i = 0
while s % 2 != 0:
	s = s - l1[i]
	i += 1
print(s)


def main():
	n = input()
	data = [int(x) for x in input().split()]
	_sum = 0
	_min = 10 ** 9
	for value in data:
		_sum += value
		if value % 2 and value < _min:
			_min = value
	print(_sum - _min if _sum % 2 else _sum)
main()


n = int(input())
li = [int(x) for x in input().split()]
s = sum(li)
if s % 2 == 0:
	print(s)
else:
	li.sort()
	for i in range(n):
		if (s - li[i]) % 2 == 0:
			print(s - li[i])
			break
	else:
		print(0)


n = int(input())
result = 0
o = []
l = list(map(int, input().split()))
for i in l:
	if i % 2 == 0:
		result += i
	else:
		o.append(i)
if len(o) % 2 == 0:
	print(sum(o) + result)
else:
	o.sort()
	O = o[1:]
	print(sum(O) + result)


z = int(input())
numbers = list(map(int, input().split()))
numbers.sort()
chet = list()
nechet = list()
m = total_sum = 0
if z == 1 and numbers[0] % 2 != 0:
	print(0)
for i in numbers:
	if i % 2 == 0:
		chet.append(i)
	else:
		nechet.append(i)
sum_chet = sum(chet)
for i in range(z):
	total_sum = sum_chet + sum(nechet[i:])
	if total_sum % 2 == 0:
		print(total_sum)
		break


n = int(input())
l = list(map(int, input().strip().split()))
even = []
odd = []
for x in l:
	if x % 2 == 0:
		even.append(x)
	else:
		odd.append(x)
even.sort()
odd.sort()
if len(odd) % 2 == 0:
	print(sum(odd) + sum(even))
else:
	print(sum(even) + sum(odd[1:]))


n = int(input())
if n == 0:
	exit()
(a, b, k) = ([], [], 0)
for i in list(map(int, input().split())):
	if i % 2 == 1:
		b.append(i)
	k = k + i
if len(b) > 0 and k % 2 == 1:
	b.sort()
	print(k - b[0])
elif k % 2 == 0:
	print(k)
else:
	print(0)


n = int(input())
a = list(map(int, input().split()))
min_odd = pow(10, 9) + 1
ans = 0
for x in a:
	if x % 2 == 1:
		min_odd = min(min_odd, x)
	ans += x
if ans % 2 == 1:
	ans -= min_odd
print(ans)


input()
o = lambda x: bool(x % 2)
m = list(map(int, input().split()))
s = sum(m)
print(s - min(filter(o, m)) if o(s) else s)


def is_odd(x):
	return x & 1
try:
	while True:
		n = int(input())
		a = list(map(int, input().split()))
		s = sum(a)
		odds = list(filter(is_odd, a))
		if is_odd(len(odds)):
			s -= min(odds)
		print(s)
except EOFError:
	pass


n = int(input())
line = str(input()).split()
line = [int(it) for it in line]
odd_c = 0
min_odd_v = max(line)
for it in line:
	if it % 2 == 1:
		if it < min_odd_v:
			min_odd_v = it
		odd_c += 1
if odd_c % 2 == 1:
	print(sum(line) - min_odd_v)
else:
	print(sum(line))


a = int(input())
li = []
j = []
l = list(map(int, input().split()))
for i in l:
	if i % 2 == 0:
		li.append(i)
	else:
		j.append(i)
j.sort()
if len(j) % 2 == 0:
	print(sum(j) + sum(li))
else:
	print(sum(li) + sum(j) - j[0])


n = int(input())
a = list(map(int, input().split()))
(l, summ) = ([], sum(a))
for i in a:
	if i % 2 == 0:
		l += [i]
	if (summ - i) % 2 == 0:
		l += [summ - i]
	if summ % 2 == 0:
		l += [summ]
print(max(l))


n = int(input())
l = list(map(int, input().split()))
odd = []
sum1 = 0
for x in l:
	if x % 2 == 0:
		sum1 += x
	else:
		odd += [x]
if len(odd) % 2 == 0:
	sum1 += sum(odd)
else:
	sum1 += sum(odd) - min(odd)
print(sum1)


n = input()
n = list(map(int, input().split()))
e = sum([x for x in n if x % 2 == 0])
o = [x for x in n if x % 2 == 1]
if len(o) % 2 == 1:
	o.remove(min(o))
print(e + sum(o))


n = int(input())
x = input()
x = x.split()
for i in range(n):
	x[i] = int(x[i])
x = sorted(x)
i = 0
res = sum(x)
su = sum(x)
while True:
	if res % 2 == 0:
		break
	res = su - x[i]
	i += 1
print(res)


n = int(input())
arr = [int(i) for i in input().split()]
arr.sort()
i = 0
while i < n:
	s = sum(arr)
	if s % 2 == 0:
		print(s)
		exit()
	else:
		while i < n and arr[i] % 2 == 0:
			i = i + 1
		arr.pop(i)


n = int(input())
arr = [int(x) for x in input().split()]
mini = 1000000001
total = 0
for num in arr:
	if num % 2 and num < mini:
		mini = num
	total += num
if total % 2:
	total -= mini
print(total)


n = int(input())
var = list(map(int, input().split()))
ans = 0
cnt = 0
var.sort()
for i in var:
	if i % 2 == 0:
		ans += i
	else:
		ans += i
		cnt += 1
if cnt % 2 == 0:
	print(ans)
else:
	for i in range(n):
		if var[i] % 2 == 1:
			ans -= var[i]
			break
	print(ans)


n = int(input())
L = list(map(int, input().split()))
Even = []
Odd = []
for i in L:
	if i % 2 == 0:
		Even += [i]
	else:
		Odd += [i]
Odd = sorted(Odd)
if len(Odd) % 2 != 0:
	del Odd[0]
print(sum(Odd) + sum(Even))


input()
(*a,) = map(int, input().split())
b = [i for i in a if i % 2]
print(sum(a) - (min(b) if len(b) % 2 else 0))


def main():
	n = int(input())
	numeros = input()
	par = 0
	impar = 0
	pares = list()
	impares = list()
	listaNum = numeros.split()
	listaNum = [int(x) for x in listaNum]
	for x in listaNum:
		if x % 2 == 0:
			pares.append(x)
		else:
			impar += 1
			impares.append(x)
	if impar % 2 == 0:
		maxSum = sum(listaNum)
	else:
		impares.remove(min(impares))
		maxSum = sum(pares) + sum(impares)
	print(maxSum)
main()


n = int(input())
s = sorted(list(map(int, input().split())))
k = sum(s)
if k % 2 == 0:
	print(k)
else:
	for j in s:
		if j % 2 != 0:
			break
	print(k - j)


import sys

def solved(n, arr):
	s = sum(arr)
	if s % 2 == 0:
		return s
	else:
		arr = sorted(arr)
		for i in range(n):
			if (s - arr[i]) % 2 == 0:
				return s - arr[i]
n = int(input())
arr = list(map(int, input().split()))
print(solved(n, arr))


t = int(input())
ol = []
el = []
o = 0
e = 0
l = list(map(int, input().split()))
for i in l:
	if i % 2 == 0:
		e = e + 1
		el.append(i)
	else:
		o = o + 1
		ol.append(i)
if e % 2 == 0 and o % 2 == 0:
	print(sum(ol) + sum(el))
elif e % 2 != 0 and o % 2 == 0:
	print(sum(ol) + sum(el))
else:
	g = sorted(ol)
	s = sum(g[1:])
	print(sum(el) + s)


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
if s % 2 == 1:
	s -= min((n for n in arr if n % 2 == 1))
print(s)


n = int(input())
a = [int(i) for i in input().split()]
k = 0
for i in range(n):
	k += a[i]
if k % 2:
	x = 1000000000
	for i in range(n):
		if a[i] % 2 and a[i] < x:
			x = a[i]
	k -= x
	print(k)
else:
	print(k)


a = int(input())
y = 0
z = []
x = [int(i) for i in input().split()]
for i in x:
	y += i
	if i % 2 == 1:
		z.append(i)
if y % 2 == 0:
	print(y)
else:
	y -= min(z)
	print(y)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from itertools import permutations as pmt
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
f = 0
var = sum(arr)
if var % 2 == 0:
	print(var)
else:
	var = 0
	od = []
	for i in range(n):
		if arr[i] % 2 != 0:
			od.append(arr[i])
		else:
			var += arr[i]
	od.sort()
	if len(od) % 2 == 0:
		var += sum(od)
	elif len(od) > 1:
		var += sum(od[1:])
	print(var)


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import stdin
(n, a) = (int(input()), sorted(arr_inp()))
ans = sum(a)
if ans & 1:
	for i in a:
		if i & 1:
			ans -= i
			break
print(ans)


n = int(input())
arr = sorted(map(lambda x: int(x), input().split(' ')))
s = sum(arr)
if s % 2 == 0:
	print(s)
else:
	for x in arr:
		if x % 2 == 1:
			s -= x
			break
	if s % 2 == 0:
		print(s)
	else:
		print(0)


n = int(input())
l = list(map(int, input().split()))
l.sort()
(l1, l2) = ([], [])
for i in range(len(l)):
	if l[i] % 2 == 0:
		l1.append(l[i])
	else:
		l2.append(l[i])
if len(l2) % 2 == 0:
	print(sum(l1) + sum(l2))
else:
	print(sum(l2[1:]) + sum(l1))


import math, fractions
n = int(input())
q = [int(x) for x in input().split()]
q.sort()
ans = sum(q)
i = 0
while ans % 2 != 0 and i < len(q):
	if q[i] % 2 != 0:
		ans -= q[i]
	i += 1
print(ans)


n = int(input())
num = list(map(int, input().split()))
num.sort()
otvet = sum(num)
if sum(num) % 2 != 0:
	for i in range(0, len(num)):
		if num[i] % 2 == 1:
			otvet = sum(num) - num[i]
			break
print(otvet)


n = int(input())
a = [int(x) for x in input().split()]
s = sum(a)
if s % 2:
	s -= min((i for i in a if i % 2))
print(s)


n = int(input())
a = list(map(int, input().split()))
Sum = 0
b = []
for i in range(n):
	if a[i] % 2 == 0:
		Sum += a[i]
	else:
		b.append(a[i])
if len(b) % 2 == 0:
	print(Sum + sum(b))
else:
	print(Sum + sum(b) - min(b))


n = int(input())
A = list(map(int, input().split()))
an = 0
odd = []
for a in A:
	if a % 2 == 0:
		an += a
	else:
		odd += [a]
odd.sort()
if len(odd) % 2 == 0:
	an += sum(odd)
else:
	an += sum(odd[1:])
print(an)


n = int(input())
a = sorted(map(int, input().split()))
k = 0
if sum(a) % 2 != 0:
	for i in a:
		if i % 2 != 0:
			c = i
			break
	for i in a:
		k += i
	print(k - c)
else:
	print(sum(a))


n = int(input())
lst = [int(x) for x in input().split(' ')]
lst.sort()
ans = sum(lst)
if ans % 2 == 1:
	for i in lst:
		if (ans - i) % 2 == 0:
			ans -= i
			break
print(ans)


n = int(input())
m = list(map(int, input().split()))[:n]
d = 0
for i in range(0, n):
	if m[i] % 2 != 0:
		d = d + 1
m.sort()
for i in range(0, n):
	if m[i] % 2 != 0:
		a = m[i]
		break
if d % 2 == 0:
	f = sum(m)
else:
	f = sum(m) - a
print(f)


fu = input()
numbers = list(map(int, input().split()))
numbers.sort()
chet = nechet = 0
for i in numbers:
	if i % 2 == 0:
		chet += 1
	else:
		nechet += 1
if nechet % 2 == 0:
	print(sum(numbers))
else:
	for i in numbers:
		if i % 2 != 0:
			numbers.remove(i)
			break
	if numbers:
		print(sum(numbers))
	else:
		print(0)


n = int(input())
x = [int(y) for y in input().split()]
s = sum(x)
if s % 2 == 0:
	print(s)
else:
	min_odd = int(10000000000.0 + 1)
	for i in x:
		if i < min_odd and i % 2 == 1:
			min_odd = i
	print(s - min_odd)


n = int(input())
x = list(map(int, input().split()))
x.sort()
x.reverse()
odds = []
evens = []
for i in x:
	if i % 2 == 0:
		evens.append(i)
	else:
		odds.append(i)
if len(odds) % 2 == 1:
	evens += odds[0:len(odds) - 1]
else:
	evens += odds
print(sum(evens))


n = int(input())
l = list(map(int, input().split()))
(x, y) = ([], [])
d = 0
for i in range(n):
	if l[i] % 2 == 0:
		x.append(l[i])
	else:
		y.append(l[i])
d = d + sum(x)
y.sort()
if len(y) % 2 == 0:
	d = d + sum(y)
else:
	for i in range(1, len(y), 1):
		d = d + y[i]
print(d)


n1 = input()
n = list(map(int, input().split()))
n.sort()
maximum_sum = 0
if sum(n) % 2 == 0:
	maximum_sum = sum(n)
else:
	for i in range(len(n)):
		if n[i] % 2 == 1:
			maximum_sum = sum(n) - n[i]
			break
print(maximum_sum)


__author__ = 'Admin'
n = int(input())
ans = 0
t = 0
m = list(map(int, input().split()))
m.sort()
for i in range(n):
	ans += m[i]
if ans % 2 == 0:
	print(ans)
else:
	for i in range(n):
		if m[i] % 2 != 0:
			t = m[i]
			break
	ans -= t
	print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=1)
ans = 0
temp = 0
for i in a:
	if i % 2 == 0:
		ans += i
	elif temp != 0:
		ans += i + temp
		temp = 0
	else:
		temp = i
print(ans)


n = int(input())
number = [int(x) for x in input().split()]
number = sorted(number)
total = sum(number)
i = 0
while total % 2 == 1:
	while number[i] % 2 == 0:
		i += 1
	total -= number[i]
print(total)


n = int(input())
a = list(map(int, input().split()))
res = sum(a)
if res % 2:
	res -= min((el for el in a if el % 2))
print(res)


n = int(input())
num = input().split()
odd = []
total = 0
for i in num:
	if int(i) % 2:
		odd.append(int(i))
	else:
		total += int(i)
odd.sort()
if len(odd) % 2:
	start = 1
else:
	start = 0
for i in range(start, len(odd)):
	total += odd[i]
print(total)


a = int(input())
b = list(map(int, input().split()))
c = 0
v = 10000000000
for i in range(a):
	c = b[i] + c
	if b[i] <= v and b[i] % 2 != 0:
		v = b[i]
if c % 2 == 0:
	print(c)
else:
	print(c - v)


n = eval(input())
l = list(map(int, input().split()))
sum = 0
i = 0
c = 0
too = True
min = 0
while i < n:
	if l[i] % 2 == 0:
		sum += l[i]
	else:
		sum = sum + l[i]
		if too == True:
			min = l[i]
			too = False
		elif min > l[i]:
			min = l[i]
		c += 1
	i += 1
if c % 2 == 0:
	print(sum)
else:
	print(sum - min)


n = int(input())
li = list(map(int, input().split()))
ki = []
ki1 = []
count = 0
count1 = 0
for i in li:
	if i % 2 != 0:
		ki1.append(i)
		count += 1
	else:
		ki.append(i)
		count1 += 1
if count % 2 == 0:
	print(sum(li))
else:
	print(sum(li) - min(ki1))


n = input()
s = tuple(map(int, input().split()))
m = 1000000000.0 + 1
t = 0
for i in s:
	t += i
	if i % 2 and i < m:
		m = i
print((0 if m > 1000000000.0 else t - m) if t % 2 else t)


import math
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
a.reverse()
(s, s1) = (0, 0)
d = 0
for i in range(n):
	if a[i] % 2 == 0:
		s += a[i]
	else:
		d += 1
if d >= 2 and d != 0:
	if d % 2 == 1:
		d -= 1
	for i in range(n):
		if a[i] % 2 != 0:
			s += a[i]
			s1 += 1
		if d == s1:
			break
print(s)


n = int(input())
values = input()
values = values.split()
ans = 0
res = -1
soma = 0
for i in range(n):
	if int(values[i]) % 2 != 0:
		if res == -1:
			res = int(values[i])
		else:
			res = min(res, int(values[i]))
		ans += 1
	soma += int(values[i])
if ans % 2 != 0:
	print(soma - res)
else:
	print(soma)


import sys
n = int(input())
l = [int(i) for i in input().split()]
ans = 0
for i in range(n):
	ans = ans + l[i]
if ans % 2 == 0:
	print(ans)
	sys.exit(0)
l.sort()
for i in range(n):
	if (ans - l[i]) % 2 == 0:
		print(ans - l[i])
		sys.exit(0)


n = int(input())
l = [int(x) for x in input().split()]
s = sum(l)
l.sort()
flag = 1
if s % 2 == 0:
	flag = 0
	print(s)
else:
	for i in range(n):
		if s % 2 == 0:
			print(s)
			flag = 0
			break
		else:
			if l[i] % 2 != 0:
				s = s - l[i]
			if i == n - 1 and s % 2 == 0:
				print(s)
				flag = 0
if flag == 1:
	print('0')


n = int(input())
x = input().split(' ')
s = 0
sm = 0
for ii in x:
	i = int(ii)
	if i & 1:
		sm = i
		x.remove(ii)
		break
for ii in x:
	i = int(ii)
	if sm > i and i & 1:
		s += sm
		sm = i
	else:
		s += i
if s & 1:
	s += sm
print(s)


n = int(input())
ls = list(map(int, input().split()))
mno = 10 ** 10
ans = sum(ls)
for i in range(n):
	if ls[i] & 1:
		mno = min(mno, ls[i])
if ans & 1:
	ans -= mno
print(ans)


n = int(input())
arr = list(map(int, input().split()))
sum = 0
mini = 10 ** 9
for i in arr:
	sum += i
	if i < mini and i % 2 == 1:
		mini = i
if sum % 2 == 0:
	print(sum)
else:
	print(sum - mini)


from math import inf

def solve(n, a):
	nodds = 0
	minodd = inf
	s = 0
	for i in range(n):
		if a[i] & 1:
			nodds += 1
			minodd = min(minodd, a[i])
		s += a[i]
	return s - minodd if nodds & 1 else s

def main():
	n = int(input())
	a = list(map(int, input().split()))[:n]
	print(solve(n, a))
main()


from itertools import *
from collections import Counter
from operator import *
from functools import reduce
import re, math
from pprint import pprint
from fractions import gcd

def sqr(x):
	return x * x

def inputarray(func=int):
	return map(func, input().split())
N = int(input())
A = list(inputarray())
res = sum(filter(lambda x: x % 2 == 0, A))
B = sorted(filter(lambda x: x % 2 == 1, A))
if len(B) % 2 == 0:
	print(res + sum(B))
else:
	print(res + sum(B[1:]))


n = input()
l = sorted(list(map(int, input().split())))
c = 0
ans = 0
odd = []
for i in l:
	if i % 2 == 0:
		ans += i
	else:
		c += 1
		odd.append(i)
ans += sum(odd)
if len(odd) % 2 != 0:
	ans -= min(odd)
print(ans)


input()
a = list(map(int, input().split()))
s = sum(a)
print(s - min((i for i in a if i % 2)) if s % 2 else s)


n = int(input())
a = list(map(int, input().split()))
b = []
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	for i in range(n):
		if a[i] % 2 != 0:
			b.append(a[i])
	b.sort()
	print(s - b[0])


_ = input()
sum = 0
count = 0
arr = list(map(int, input().split(' ')))
min_val = float('inf')
for i in arr:
	if i % 2 == 1:
		count += 1
		if i < min_val:
			min_val = i
	sum += i
print([sum, sum - min_val][count % 2])


n = int(input())
m = list(map(int, input().split()))
s = 0
min = 0
for i in range(0, n):
	s += m[i]
	if m[i] % 2 != 0:
		if min == 0:
			min = m[i]
		elif m[i] < min:
			min = m[i]
if s % 2 == 0:
	print(s)
else:
	print(s - min)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
min_odd = 1000000001
for i in range(n):
	if a[i] < min_odd and a[i] % 2 == 1:
		min_odd = a[i]
if s % 2 == 0:
	print(s)
else:
	print(s - min_odd)


input()
lst = [int(i) for i in input().split()]
minOdd = 0
s = 0
for i in lst:
	s += i
	if i % 2 and (i < minOdd or minOdd == 0):
		minOdd = i
print(s if s % 2 == 0 else s - minOdd)


def main():
	input()
	numbers = [int(_) for _ in input().split()]
	count_odd = sum((x % 2 != 0 for x in numbers))
	result = sum(numbers)
	if count_odd % 2 != 0:
		result -= min((x for x in numbers if x % 2 != 0))
	print(result)
main()


n = int(input())
p = [int(i) for i in input().split()]
odd = [i for i in p if i % 2 == 1]
if sum(p) % 2 == 0:
	print(sum(p))
else:
	while sum(p) % 2 != 0:
		p.remove(min(odd))
	print(sum(p))


n = int(input(''))
tab = [int(i) for i in input().split()]
tab.sort()
i = 0
sum = 0
while i < n:
	sum += tab[i]
	i += 1
som = sum
i = 0
isEven = sum % 2 == 0
while not isEven:
	sum = som - tab[i]
	i += 1
	isEven = sum % 2 == 0
print(sum)


n = int(input())
a = [int(x) for x in input().split()]
s = 0
for i in a:
	s += i
if s % 2 == 0:
	print(s)
else:
	m = 2 * 10 ** 9
	for i in a:
		if i % 2 == 1 and i < m:
			m = i
	print(s - m)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	odd = []
	for i in range(n):
		if a[i] % 2 != 0:
			odd.append(a[i])
	x = min(odd)
	s -= x
	print(s)


from math import sqrt, pow, ceil
from decimal import *
l1 = int(input())
l2 = input().split()
l2 = [int(i) for i in l2]
impc = 0
minzada = 1000000001
resp = 0
printed = False
if l1 == 1:
	printed = True
	if l2[0] % 2 == 0:
		print(l2[0])
	else:
		print(0)
if not printed:
	for i in range(l1):
		x = l2[i]
		if x % 2 == 1:
			impc += 1
			minzada = min(x, minzada)
		resp += x
	if impc % 2 == 1:
		resp -= minzada
	print(resp)


n = int(input())
numbers = []
cnt = 0
for c in list(map(int, input().split())):
	if not c % 2:
		cnt += c
	else:
		numbers.append(c)
numbers.sort()
while len(numbers) > 1:
	cnt += numbers.pop()
	cnt += numbers.pop()
print(cnt)


n = int(input())
l = [int(i) for i in input().split()]
s = sum(l)
if s % 2 == 0:
	print(s)
else:
	mini = min([abs(i) for i in l if i % 2])
	print(s - mini)


n = int(input())
list1 = sorted(list(map(int, input().split(' '))), reverse=True)
odd = 0
sum1 = 0
c = 0
for j in range(n):
	if list1[j] & 1:
		odd = list1[j]
		sum1 += list1[j]
		c += 1
	else:
		sum1 += list1[j]
if c & 1:
	print(sum1 - odd)
else:
	print(sum1)


n = int(input())
ls = [int(i) for i in input().split()]
odd = []
count = 0
total = 0
for i in ls:
	if i % 2 == 0:
		total += i
	else:
		count += 1
		odd.append(i)
if count % 2 == 0:
	total += sum(odd)
else:
	odd.sort()
	total += sum(odd[1:])
print(total)


n = int(input())
s = [int(i) for i in input().split()]
res = 0
mass = []
for i in s:
	if i % 2 == 0:
		res += i
	else:
		mass.append(i)
if len(mass) % 2 == 0:
	res += sum(mass)
else:
	mass.sort()
	res += sum(mass[1:])
print(res)


n = int(input())
l = map(int, input().split())
l = sorted(l)
s = sum(l)
if s & 1:
	for x in l:
		if x & 1:
			s = s - x
			break
print(s)


import unittest
import sys

class Shark:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		[self.n] = map(int, uinput().split())
		self.nums = list(map(int, uinput().split()))

	def calculate(self):
		s = sum(self.nums)
		srt = sorted(self.nums)
		minodd = 0
		for m in srt:
			if m % 2:
				minodd = m
				break
		result = s if not s % 2 else s - minodd
		return str(result)

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = '3\n1 2 3'
		d = Shark(test)
		self.assertEqual(d.n, 3)
		self.assertEqual(d.nums, [1, 2, 3])
		self.assertEqual(Shark(test).calculate(), '6')
		test = '1\n1'
		self.assertEqual(Shark(test).calculate(), '0')
		test = '1\n1 1 3 2'
		self.assertEqual(Shark(test).calculate(), '6')
		test = '5\n999999999 999999999 999999999 999999999 999999999'
		self.assertEqual(Shark(test).calculate(), '3999999996')
		test = ''
		test = ''

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Shark(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Shark().calculate())


n = int(input())
x = list(map(int, input().split()))
x = sorted(x)
e = []
o = []
stat = False
for i in x:
	if i & 1 == False:
		e.append(i)
	elif i & 1:
		o.append(i)
if len(o) % 2 == 1:
	o.pop(0)
print(sum(e) + sum(o))


n = int(input())
odd = 99999999990
s = 0
for i in map(int, input().split()):
	if i % 2 == 1:
		odd = min(odd, i)
	s += i
print(s if s % 2 == 0 else s - odd)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	minval = 10 ** 9 + 1
	for it in a:
		if it % 2 == 1 and it < minval:
			minval = it
	s -= minval
	print(s)


n = int(input())
numbers = [int(val) for val in input().split()]
sum_ = sum(numbers)
if sum_ % 2 == 0:
	print(sum_)
else:
	numbers = sorted(list(numbers))
	for num in numbers:
		if num % 2 != 0:
			sum_ -= num
			if sum_ % 2 == 0:
				print(sum_)
				break
	else:
		print('0')


n = int(input())
l = list(map(int, input().split()))
s = sorted([x for x in l if x % 2 == 1])
t = sum(l)
if t % 2:
	t -= s[0]
print(t)


n = int(input())
l = list(map(int, input().split()))
s = 0
cv = 0
for i in range(n):
	if l[i] % 2 == 0:
		s = s + l[i]
		l[i] = 0
	else:
		cv = cv + 1
if cv % 2 == 0:
	for i in l:
		s = s + i
else:
	l.sort(reverse=True)
	for i in range(cv - 1):
		s = s + l[i]
print(s)


n = int(input().strip())
kkk = list(map(int, input().split()))
tok = []
juft = []
for i in kkk:
	if i % 2 == 0:
		juft.append(i)
	else:
		tok.append(i)
if len(tok) % 2 == 0:
	print(sum(tok) + sum(juft))
else:
	print(sum(tok) + sum(juft) - min(tok))


n = int(input())
a = list(map(int, input().split()))
ans = sum(a)
t = 999999999
for i in range(n):
	if a[i] % 2 == 1:
		t = min(t, a[i])
if ans % 2 == 0:
	print(ans)
else:
	print(ans - t)


n = int(input())
a = sorted(list(map(int, input().split())))
sum1 = sum(a)
if sum1 % 2:
	for i in a:
		if i % 2:
			sum1 -= i
			break
	if sum1 % 2:
		print(0)
	else:
		print(sum1)
elif sum1 > 0:
	print(sum1)
else:
	print(0)


n = int(input())
lis = [int(a) for a in input().split(' ')]
sum = 0
minOdd = 99999999999999999999999999
for a in lis:
	sum = sum + a
	if a % 2 != 0:
		minOdd = min(minOdd, a)
if sum % 2 == 0:
	print(sum)
else:
	print(sum - minOdd)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
odds = 0
sum = 0
lastodd = 0
for i in a:
	if i % 2 == 0:
		sum += i
	else:
		sum += i
		odds += 1
		lastodd = i
if odds % 2 != 0:
	sum -= lastodd
print(sum)


n = int(input())
a = list(map(int, input().split()))
a.sort()
o = 0
f = 0
for v in a:
	if v & 1:
		o += 1
		if o == 1:
			f = v
if o & 1:
	print(sum(a) - f)
else:
	print(sum(a))


n = int(input())
x = [int(x) for x in input().split()]
y = []
z = []
for i in x:
	if i % 2 == 0:
		y.append(i)
	else:
		z.append(i)
if len(z) % 2 != 0:
	print(sum(z) - min(z) + sum(y))
else:
	print(sum(z) + sum(y))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = LI()
	r = sum(a)
	m = inf
	c = 0
	for t in a:
		if t % 2 == 1:
			c += 1
			if m > t:
				m = t
	if c % 2 == 1:
		r -= m
	return r
print(main())


n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
d = 0
for i in a:
	c += i
if c % 2 != 0:
	while d != -1:
		if a[d] % 2 != 0:
			c = c - a[d]
			d = -1
		else:
			d += 1
print(c)


n = int(input())
s = list(map(int, input().split()))
A = []
k = 0
for elem in s:
	if elem % 2 == 0:
		k += elem
	else:
		A.append(elem)
A.sort()
if len(A) % 2 == 0:
	for elem in A:
		k += elem
else:
	for i in range(len(A) - 1, 0, -1):
		k += A[i]
print(k)


input()
l = list(map(int, input().split()))
b = [i for i in l if i % 2 == 1]
print(sum(l) - (min(b) if len(b) % 2 else 0))


n = int(input())
s = input().split()
a = list(map(int, s))
min = 1000000000
sum = 0
for i in range(n):
	sum = sum + a[i]
	if a[i] % 2 == 1 and a[i] < min:
		min = a[i]
if sum % 2 == 0:
	print(sum)
else:
	print(sum - min)


n = int(input())
l = sorted(list(map(int, input().split())))
s = sum(l)
i = 0
while s % 2 != 0:
	s -= l[i]
	if s % 2 == 0:
		break
	s += l[i]
	i += 1
print(s)


import functools
n = int(input())
arr = [int(i) for i in input().split()]
s = sum(arr)
if s % 2 != 0:
	s -= min(filter(lambda x: x % 2, arr))
print(s)


n = int(input())
s = [int(i) for i in input().split()]
m = 0
for i in range(n):
	m = m + s[i]
if m % 2 == 0:
	print(m)
else:
	s.sort()
	t = 0
	while s[t] % 2 == 0:
		t = t + 1
	m = m - s[t]
	print(m)


n = int(input())
li = list(map(int, input().split()))
li.sort()
k = sum(li)
if k % 2 == 0:
	print(k)
else:
	for i in li:
		if (k - i) % 2 == 0:
			print(k - i)
			break


n = int(input())
list = list(input().split())
odd = []
sum = 0
for i in range(0, len(list)):
	if int(list[i]) % 2 == 0:
		sum += int(list[i])
	else:
		odd.append(int(list[i]))
odd.sort()
while len(odd) >= 2:
	sum += int(odd[len(odd) - 1]) + int(odd[len(odd) - 2])
	odd.pop(len(odd) - 1)
	odd.pop(len(odd) - 1)
print(sum)


n = int(input())
a = list(map(int, input().split()))
mn = 1000000000000000000000001
if sum(a) % 2 == 0:
	print(sum(a))
else:
	for i in range(n):
		if a[i] % 2 == 1:
			mn = min(mn, a[i])
	print(sum(a) - mn)


n = int(input())
numbers = [int(val) for val in input().split()]
min_odd = 9999999999999999
odd_sum = 0
ans = 0
for i in range(n):
	if numbers[i] % 2 == 0:
		ans += numbers[i]
	else:
		odd_sum += numbers[i]
		min_odd = min(numbers[i], min_odd)
if odd_sum % 2 == 0:
	print(ans + odd_sum)
else:
	print(ans + (odd_sum - min_odd))


n = int(input())
l = list(map(int, input().split()))
a = sum(l)
(x, t) = (0, [])
if a % 2 == 0:
	print(a)
else:
	for i in range(n):
		if l[i] % 2 != 0:
			t.append(l[i])
	x = min(t)
	print(a - x)


n = int(input())
odd = []
ans = 0
for e in [int(c) for c in input().split()]:
	if e % 2 == 0:
		ans += e
	else:
		odd.append(e)
odd.sort(reverse=True)
lim = len(odd) if len(odd) % 2 == 0 else len(odd) - 1
print(ans + sum(odd[:lim]))


input()
l = list(map(int, input().split()))
try:
	min1 = min([i for i in l if i % 2 == 1])
except:
	min1 = 0
print(sum(l) - (min1 if sum(l) % 2 else 0))


n = int(input())
lst = list(map(int, input().split()))
lst.sort()
l0 = list(filter(lambda x: x % 2 == 0, lst))
l1 = list(filter(lambda x: x % 2, lst))
print(sum(l0) + sum(l1) - l1[0] if len(l1) % 2 else sum(l0) + sum(l1))


n = int(input())
a = list(map(int, input().split()))
isOdd = any((i % 2 != 0 for i in a))
if not isOdd:
	print([sum(a), 0][sum(a) % 2 != 0])
else:
	print([sum(a), sum(a) - min((i for i in a if i % 2 == 1))][sum(a) % 2 != 0])


n = int(input())
L = list(map(int, input().split()))
L1 = [L[i] for i in range(len(L)) if L[i] % 2 == 0]
L2 = [L[i] for i in range(len(L)) if L[i] % 2 != 0]
L2.sort(reverse=True)
sum = sum(L1)
for i in range(len(L2) - len(L2) % 2):
	sum += L2[i]
print(sum)


import math
import sys
n = int(input())
mx = 1000000000000
x = list(map(int, input().split()))
sum = 0
for i in range(n):
	if x[i] % 2 == 1:
		mx = min(x[i], mx)
	sum += x[i]
if sum % 2 == 1:
	sum -= mx
print(sum)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
(ans, even, odd) = (0, 0, 0)
a.sort()
for i in range(n):
	if a[i] % 2 != 0:
		even += 1
		odd += 1
		if even == 1:
			ans = a[i]
if odd % 2 == 0:
	print(s)
else:
	print(s - ans)


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))
n = int(input())
a = li()
ans = 0
od = []
for i in range(n):
	if a[i] % 2 == 0:
		ans += a[i]
	else:
		od.append(a[i])
if len(od) % 2:
	od.sort()
	print(ans + sum(od[1:]))
else:
	print(ans + sum(od))


n = int(input())
l = list(map(int, input().split()))
nch = []
ans = 0
for i in l:
	if i % 2 != 0:
		nch.append(i)
	else:
		ans += i
nch.sort()
begin = len(nch) % 2
for i in range(begin, len(nch)):
	ans += nch[i]
print(ans)


n = int(input())
result = 0
minOdd = 999999999
numbers = [int(i) for i in input().split(' ')]
for num in numbers:
	if num % 2 != 0:
		minOdd = min(minOdd, num)
	result = result + num
if result % 2 == 0:
	print(result)
else:
	print(result - minOdd)


n = int(input())
l = [int(x) for x in input().split()]
l.sort()
even_sum = 0
odd_sum = 0
smallest_odd = 0
for x in l:
	if x % 2 == 0:
		even_sum += x
	else:
		odd_sum += x
		if smallest_odd == 0:
			smallest_odd = x
if odd_sum % 2 != 0:
	odd_sum -= smallest_odd
print(int(even_sum + odd_sum))


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
ls = set(l)
lss = list(ls)
lss.sort()
c = 0
for i in range(len(lss)):
	if lss[i] % 2 != 0:
		c = lss[i]
		break
if s % 2 == 0:
	print(s)
else:
	print(s - c)


import math
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
t = math.fsum(a)
if t % 2 == 0:
	print(int(t))
else:
	for i in range(len(a)):
		if a[i] % 2 == 1:
			print(int(t - a[i]))
			break


n = int(input())
mi = 999999999999999999
s = 0
a = [int(n) for n in input().split(' ')]
for i in range(len(a)):
	s = s + a[i]
	if a[i] < mi and a[i] % 2 == 1:
		mi = a[i]
if s % 2 == 0:
	print(s)
else:
	print(s - mi)


n = int(input())
a = list(map(int, input().split()))
ans = 0
less = 10 ** 9 + 1
for i in a:
	if i % 2 == 1 and i < less:
		less = i
	ans += i
if ans % 2 == 0:
	print(ans)
elif less == 10 ** 9 + 1:
	print('0')
else:
	print(ans - less)


sets = int(input())
data = list(map(int, input().split()))
data_chet = [i for i in data if i % 2 == 0]
data_nechet = [i for i in data if i % 2 != 0]
answer = 0
if len(data_nechet) % 2 == 0:
	answer += sum(data_nechet)
elif len(data_nechet) % 2 != 0:
	del data_nechet[data_nechet.index(min(data_nechet))]
	answer += sum(data_nechet)
answer += sum(data_chet)
print(answer)


n = int(input())
all = tuple(map(int, input().split()))
s = sum(all)
if s % 2 == 0:
	print(str(s))
else:
	min_odd = min([i for i in all if i % 2 == 1])
	print(str(s - min_odd))


def main():
	n = int(input())
	a = [int(i) for i in input().split()]
	cnt = 0
	mi = 10 ** 9
	for i in a:
		if i % 2 == 1:
			cnt ^= 1
			mi = min(mi, i)
	if not cnt:
		mi = 0
	print(sum(a) - mi)
main()


a = input()
n = list(map(int, input().split()))
n.sort()
n.reverse()
chet = []
neChet = []
for i in range(len(n)):
	if n[i] % 2 == 0:
		chet.append(n[i])
	else:
		neChet.append(n[i])
summa = summaChet = sum(chet)
for i in range(len(neChet)):
	summa += neChet[i]
	if summa % 2 == 0 and summa > summaChet:
		summaChet = summa
print(summaChet)


n = int(input())
lst = [int(k) for k in input().split()]
min_odd = 0
res = 0
for i in range(n):
	res += lst[i]
	if lst[i] % 2 != 0:
		if min_odd == 0:
			min_odd = lst[i]
		else:
			min_odd = min(min_odd, lst[i])
if res % 2 == 0:
	print(res)
else:
	print(res - min_odd)


n = int(input())
oc = 0
ar = input().split()
for i in range(n):
	ar[i] = int(ar[i])
	if ar[i] % 2 != 0:
		oc += 1
ar.sort()
if oc % 2 != 0:
	oc -= 1
tot = 0
for j in range(n - 1, -1, -1):
	if ar[j] % 2 == 0:
		tot += ar[j]
	elif oc > 0:
		tot += ar[j]
		oc -= 1
print(tot)


n = int(input())
l = [int(i) for i in input().split()]
t = sum(l)
if t % 2 == 0:
	print(t)
else:
	o = [i for i in l if i % 2 != 0]
	print(t - min(o))


n = int(input())
a = input().split()
a = [int(i) for i in a]
list1 = []
list2 = []
for i in a:
	if i % 2 == 0:
		list1.append(i)
	else:
		list2.append(i)
b = 0
for i in list1:
	b = b + i
if len(list2) % 2 == 0:
	for i in list2:
		b = b + i
	print(b)
else:
	c = min(list2)
	d = list2.index(c)
	del list2[d]
	for i in list2:
		b = b + i
	print(b)


t = int(input())
s = input()
p = [int(s) for s in s.split()]
f = 0
m = 0
n = 0
p.sort()
for i in range(t - 1, -1, -1):
	if p[i] % 2 == 0:
		n += p[i]
	elif f == 0:
		m = p[i]
		f = 1
	elif f == 1:
		n += p[i]
		n += m
		f = 0
		m = 0
print(n)


is_debug = False
n = int(input())
a = list(map(int, input().split()))
e = []
o = []
for i in range(n):
	if a[i] % 2 == 0:
		e.append(a[i])
	else:
		o.append(a[i])
o = sorted(o)
print(f'e={e}, o={o}', end='|') if is_debug else ''
t = sum(e) + sum(o[0 if len(o) % 2 == 0 else 1:])
print(f'{t}')


n = int(input())
odd = 10 ** 10
out = 0
a = list(map(int, input().split()))
for i in a:
	if i % 2 == 0:
		out += i
	else:
		out += i
		if i < odd:
			odd = i
if out % 2 == 0:
	print(out)
else:
	print(out - odd)


n = int(input())
v = [int(x) for x in input().split()]
impar = []
sum = 0
for i in range(n):
	sum += v[i]
	if v[i] & 1:
		impar.append(v[i])
impar.sort()
if len(impar) & 1:
	sum -= impar[0]
print(sum)


n = int(input())
l1 = [int(x) for x in input().split()]
l2 = [int(x) for x in l1 if x % 2]
l3 = [int(x) for x in l1 if x % 2 == 0]
ans = sum(l3)
if len(l2) >= 2:
	if len(l2) % 2:
		l2.remove(min(l2))
	ans += sum(l2)
print(ans)


n = int(input())
nums = [int(y) for y in input().split()]
numodds = 0
smallestodd = 10000000000
thesum = 0
for x in nums:
	thesum += x
	if x % 2 == 1:
		numodds += 1
		if x < smallestodd:
			smallestodd = x
if numodds % 2 == 0:
	print(thesum)
else:
	print(thesum - smallestodd)


input()
(min_odd, max_sum) = (999999999, 0)
for num in map(int, input().split()):
	(min_odd, max_sum) = (min(num, min_odd) if num % 2 else min_odd, max_sum + num)
print(max_sum - min_odd if max_sum % 2 else max_sum)


input()
li = list(map(int, input().split()))
print(sum(li) if sum(li) % 2 == 0 else sum(li) - min(filter(lambda x: x & 1, li)))


n = int(input())
l = list(map(int, input().split()))
odd = []
for j in l:
	if j % 2 != 0:
		odd.append(j)
jam = 0
for i in l:
	jam = jam + i
if jam % 2 == 0:
	print(jam)
else:
	while jam % 2 != 0:
		jam = jam - min(odd)
	print(jam)


n = int(input())
an = list(map(int, input().split()))
minodd = 10 ** 9
codd = 0
res = 0
for i in an:
	if i % 2 != 0:
		codd += 1
		if i < minodd:
			minodd = i
	res += i
if codd % 2 != 0:
	res -= minodd
print(res)


n = int(input())
l = list(map(int, input().split()))
k = list(filter(lambda x: x % 2, l))
if len(k) == 0:
	print(sum(l))
else:
	print([sum(l), sum(l) - min(k)][sum(l) % 2])


def main(n, a):
	s = sum(a)
	if s % 2 == 0:
		return s
	if n == 1:
		return 0
	evens = list(filter(lambda ai: ai % 2 == 0, a))
	if len(evens) == 0:
		ma = a[0] + a[1]
	else:
		ma = evens[0]
	for i in range(n):
		if (s - a[i]) % 2 == 0:
			ma = max(ma, s - a[i])
	return ma
print(main(int(input()), list(sorted(list(map(int, input().split(' ')))))))


x = int(input())
if x != 1:
	y = list(map(int, input().split()))
	y.sort()
	z = sum(y)
else:
	z = int(input())
if x == 1 and z % 2 == 1:
	print(0)
elif z % 2 == 0:
	print(z)
else:
	for i in range(x):
		if y[i] % 2 != 0:
			z -= y[i]
			break
	print(z)


garbage = input()
a = list(map(int, input().rstrip().split(' ')))
a1 = [ai for ai in a if ai % 2]
a2 = [ai for ai in a if not ai % 2]
total = sum(a2)
if len(a1) % 2 and len(a1) > 1:
	a1.pop(a1.index(min(a1)))
	total += sum(a1)
elif len(a1) % 2 == 0:
	total += sum(a1)
print(total)


n = int(input())
s = 0
m = 100000000000
for i in map(int, input().split()):
	s += i
	if i % 2 != 0:
		m = min(i, m)
if s % 2 != 0:
	s -= m
print(s)


n = int(input())
a = sorted(map(int, input().split()))
s = sum(a)
if s % 2:
	for i in a:
		if i % 2:
			s -= i
			break
print(s)


n = int(input())
l = list(map(int, input().split()))
odd = []
nodd = []
for i in l:
	if i % 2 == 1:
		odd.append(i)
	else:
		nodd.append(i)
odd.sort()
print(sum(nodd) + sum(odd[len(odd) % 2:]))


n = int(input())
lst = list(map(int, input().split()))
s = sum(lst)
if s % 2 == 0:
	print(s)
else:
	odd = float('inf')
	for i in range(n):
		if lst[i] % 2 != 0:
			odd = min(odd, lst[i])
	print(s - odd)


a = int(input())
num_list = [int(i) for i in list(input('').split(' '))]
odd = list(filter(lambda x: x % 2 != 0, num_list))
odd.sort(reverse=True)
if len(odd) % 2 == 0:
	print(sum(num_list))
else:
	num_list.remove(odd[-1])
	print(sum(num_list))


n = int(input())
array = sorted(list(map(int, input().split())))
odd = 0
for i in array:
	if i % 2:
		odd = i
		break
total = sum(array)
if total % 2:
	total -= odd
if len(array) == 1 and total % 2:
	print(0)
else:
	print(total)


n = int(input())
l = list(map(int, input().split()))
mn = None
c = 0
for i in l:
	if i % 2:
		c += 1
		if mn == None or i < mn:
			mn = i
print(sum(l) - mn if c % 2 else sum(l))


n = int(input())
l = list(map(int, input().split()))
l.sort()
s = sum(l)
d = []
for i in range(n):
	if l[i] % 2 == 1:
		d.append(l[i])
if s % 2 == 0:
	print(s)
else:
	print(s - d[0])


input()
n = map(int, input().split())
min_n = 1 + 10 ** 9
s = 0
for x in n:
	if x < min_n and x % 2:
		min_n = x
	s += x
if not s % 2:
	print(s)
else:
	print(s - min_n)


n = int(input())
li = list(map(int, input().split()))
odd = sorted([i for i in li if i % 2 != 0])
even = [i for i in li if i % 2 == 0]
if len(odd) % 2 != 0:
	odd.remove(odd[0])
	print(sum(odd) + sum(even))
else:
	print(sum(odd) + sum(even))


n = int(input())
s = input()
l = s.split()
lo = []
i = 0
sum = 0
j = 0
k = 0
while i < n:
	sum = sum + int(l[i])
	i += 1
while j < n:
	if int(l[j]) % 2 == 1:
		lo.append(int(l[j]))
		j += 1
		k += 1
	else:
		j += 1
if k % 2 == 0:
	print(sum)
else:
	m = min(lo)
	print(sum - m)


x = int(input())
numbers = [int(n) for n in input().split()]
x = sorted(numbers)
s = sum(x)
if s % 2 == 0:
	ans = s
else:
	for z in x:
		if z % 2 == 1:
			ans = s - z
			break
print(ans)


import sys

def rr():
	return sys.stdin.readline().rstrip()
rp = print

def print(*args, **kwargs):
	rp('DBG:# ', *args, **kwargs, file=sys.stderr)

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))

def rrle():
	return (line.rstrip() for line in sys.stdin.readlines())

def rrtl():
	return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'

def cpc(arr):
	return zip(arr, arr[1:])
from itertools import accumulate
from itertools import groupby
from itertools import permutations

def grp(x, key=None):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def dpp(a, b=''):
	print('#| {} |#:^ {} ^:'.format(a, b))

def str_join(i, sep=' '):
	return sep.join(map(str, i))
MOD17 = 10 ** 9 + 7

def read():
	return rnar()
	return (*rrl(),)

def solve(n, arr):
	arr.sort(reverse=True)
	s = sum(arr)
	if s % 2 == 0:
		return s
	s = s - min((i for i in arr if i % 2 == 1))
	if s % 2 == 0:
		return s
	return 0
	return ans
test_count = 1
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	rp(result)


n = int(input())
st = list(map(int, input().split(' ')))
st1 = []
st2 = []
for i in range(len(st)):
	if int(st[i]) % 2 == 1:
		st2.append(st[i])
	else:
		st1.append(st[i])
if len(st2) % 2 == 1:
	del st2[st2.index(min(st2))]
st1.extend(st2)
print(sum(st1))


count = int(input())
list = list(map(int, input().split()))
answer = 0
listodd = 1000000000
for value in list:
	answer += value
	if value % 2 != 0:
		listodd = min(listodd, value)
if answer % 2 == 0:
	print(answer)
else:
	print(answer - listodd)


k = int(input())
a = [int(x) for x in input().split()]
f = sum(a)
a.sort()
for i in range(len(a)):
	if a[i] % 2 == 1:
		min = a[i]
		break
	else:
		continue
if f % 2 == 1:
	f = f - min
print(f)


input()
nums = list(map(int, input().split()))
n_sum = sum(nums)
print(n_sum - min(filter(lambda x: x % 2, nums)) if n_sum & 1 else n_sum)


size = input()
array = [int(i) for i in input().split(' ')]
if sum(array) % 2 == 0:
	print(sum(array))
else:
	x = list(filter(lambda a: a % 2 == 1, array))
	y = sorted(x)[0]
	array.remove(y)
	print(sum(array))


n = int(input())
a = [int(i) for i in input().split()]
s = sum(a)
e = -1
m = 100000000000
for e in a:
	if e % 2 == 1:
		m = min(e, m)
if s % 2 == 0:
	print(s)
else:
	print(s - m)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
ma = 0
l.sort()
for i in range(len(l)):
	if s % 2 == 0 and s > ma:
		ma = s
	elif l[i] % 2 != 0:
		s -= l[i]
print(max(s, ma))


def solve(n, a):
	odds = []
	evens = 0
	a.sort()
	for i in a:
		if i & 1:
			odds.append(i)
		else:
			evens += i
	return evens + (sum(odds) if len(odds) % 2 == 0 else sum(odds[1:]))

def main():
	n = int(input())
	a = list(map(int, input().split()))[:n]
	print(solve(n, a))
main()


input()
x = input().split()
m = 10000000000.0
s = 0
for i in x:
	j = int(i)
	s += j
	if j % 2 != 0 and j < m:
		m = j
print(s if s % 2 == 0 else s - m)


from bisect import insort
n = int(input())
numbers = [int(i) for i in input().split(' ')]
even_number = []
odd_number = []
result = 0
for num in numbers:
	if num % 2 == 0:
		even_number.append(num)
	else:
		insort(odd_number, num)
result += sum(even_number)
odd_number_len = len(odd_number)
if len(odd_number) % 2 == 0:
	result += sum(odd_number)
else:
	result += sum(odd_number[1:])
print(result)


a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
total = 0
odds = []
for i in b:
	if i % 2 == 0:
		total += i
	else:
		odds.append(i)
		total += i
if len(odds) % 2 == 1:
	total -= min(odds)
print(total)


def read_list():
	return [int(i) for i in input().split()]

def new_list(n):
	return [0 for i in range(n)]

def new_matrix(n, m=0):
	return [[0 for i in range(m)] for i in range(n)]
n = int(input())
a = read_list()
(odd, even) = ([], [])
for e in a:
	if e % 2 == 0:
		even.append(e)
	else:
		odd.append(e)
if len(odd) % 2 == 0:
	print(sum(odd) + sum(even))
	exit()
(mini, m) = (0, float('inf'))
for i in range(len(odd)):
	if odd[i] < m:
		m = odd[i]
		mini = i
print(sum(odd[:mini]) + sum(odd[mini + 1:]) + sum(even))


import sys
import math
from statistics import mean
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
li = inlt()
s = sum(li)
if s % 2 == 0:
	print(s)
else:
	li.sort()
	for i in range(n):
		if li[i] % 2 != 0:
			s = s - li[i]
			break
	print(s)


n = int(input())
numbers = list(map(int, input().split()))
s = sum(numbers)
if s % 2 != 0:
	min_odd = s
	for i in range(n):
		if numbers[i] % 2 != 0 and numbers[i] < min_odd:
			min_odd = numbers[i]
	s -= min_odd
print(s)


n = int(input())
data = list(map(int, input().split()))
data.sort(reverse=True)
(data_odd, _sum) = ([], 0)
for i in data:
	if i % 2:
		data_odd.append(i)
		if len(data_odd) == 2:
			_sum += sum(data_odd)
			data_odd = []
	else:
		_sum += i
print(_sum)


n = input()
n = int(n, 10)
su = 0
su_t = 0
mi = 10000000000.0
str = input()
li = list(str.split())
for a in li:
	a = int(a, 10)
	if a % 2 == 0:
		su += a
	else:
		su_t += a
		if a < mi:
			mi = a
if su_t % 2 != 0:
	su_t -= mi
print(su + su_t)


num_of_int = int(input())
numbers = list(map(int, input().split()))
numbers = sorted(numbers)
start = sum(numbers)
counter = 0
y = False
if start % 2 != 0:
	for e in numbers:
		if (start - e) % 2 == 0:
			start = start - e
			break
print(start)


n = input()
arr = list(map(int, input().split()))
odd = []
even = []
for x in arr:
	if x % 2 == 1:
		odd.append(x)
	else:
		even.append(x)
odd.sort()
sum1 = sum(odd)
sum1 = sum1 + sum(even)
if sum1 % 2 == 1:
	sum1 = sum1 - odd[0]
print(sum1)


n = int(input())
l = [int(x) for x in input().split()]
(sm, e, mn) = (0, 0, 1000000001)
for i in l:
	if i % 2 != 0:
		sm += i
		mn = min(mn, i)
		e += 1
	else:
		sm += i
if e % 2 == 0:
	print(sm)
else:
	print(sm - mn)


n = int(input())
a = map(int, input().split())
a = list(a)
a.sort()
x = sum(a)
q = 0
if x % 2 == 0:
	print(x)
elif x % 2 != 0:
	for i in a:
		if i % 2 == 0:
			q = 0
		elif i % 2 != 0:
			q = i
			break
	print(x - q)


n = int(input())
l = input()
l = l.split(' ')
for i in range(len(l)):
	l[i] = int(l[i])
s = 0
g = []
for i in range(n):
	s += l[i]
	if l[i] % 2 == 1:
		g.append(l[i])
if len(g) % 2 == 0:
	print(s)
else:
	c = min(g)
	print(s - c)


n = int(input())
a = [int(s) for s in input().split()]
a.sort()
sum = 0
for i in range(n):
	sum += a[i]
ans = sum
i = 0
while ans % 2 == 1:
	ans = sum - a[i]
	i += 1
print(ans)


n = int(input())
c = list(map(int, input().split()))
k = 10 ** 9
l = 0
s = 0
for i in range(n):
	if c[i] % 2 == 1:
		l += 1
		if c[i] < k:
			k = c[i]
	s += c[i]
if l % 2 == 1:
	s -= k
print(s)


n = int(input())
z = input()
z = z.split()
z = list(map(int, z))
odd = []
ans = 0
for i in z:
	if i % 2 == 0:
		ans += i
	else:
		odd.append(i)
flag = len(odd)
odd.sort()
odd.reverse()
if flag % 2 == 0:
	for i in odd:
		ans += i
else:
	for i in range(flag - 1):
		ans += odd[i]
print(ans)


import sys

def main():
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	t = -1
	c = 0
	for i in range(n):
		ans += a[i]
		if a[i] % 2 == 1:
			if t == -1 or a[t] > a[i]:
				t = i
			c += 1
	if c % 2 == 1:
		ans -= a[t]
	print(ans)
main()


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
if s % 2 == 1:
	b = 10 ** 9 + 1
	for e in l:
		if e % 2 == 1 and e < b:
			b = e
	if b == 10 ** 9 + 1:
		s = 0
	else:
		s -= b
print(s)


input()
l = list(map(int, input().split()))
min = 1000000001
sum = 0
for a in l:
	if a < min and a % 2 == 1:
		min = a
	sum += a
if sum % 2 != 0:
	sum -= min
print(sum)


n = int(input())
l = list(map(int, input().split()))
x = sum(l)
l.sort()
y = 0
if x % 2 == 0:
	print(x)
	exit()
else:
	for i in range(n):
		if l[i] % 2 == 1:
			y = l[i]
			break
	x -= y
print(x)


n = int(input())
l = list(map(int, input().split()))
if sum(l) % 2 == 0:
	print(sum(l))
else:
	l.sort()
	for i in range(n):
		if l[i] % 2 == 1:
			l.remove(l[i])
			break
	print(sum(l))


n = int(input())
ls = input().split(' ')
sum = 0
for i in range(n):
	ls[i] = int(ls[i])
	sum += ls[i]
ans = 0
if sum % 2 == 0:
	ans = sum
else:
	for i in range(n):
		if (sum - ls[i]) % 2 == 0:
			ans = max(ans, sum - ls[i])
print(ans)


input()
n = [int(i) for i in input().split()]
nechet = [i for i in n if i % 2]
res = sum(n)
while res % 2:
	res -= min(nechet)
	nechet.remove(min(nechet))
print(res)


def main():
	from sys import stdin, stdout
	stdin.readline()
	l = sorted(list(map(int, stdin.readline().split())))
	asum = sum(l)
	if asum & 1:
		for i in l:
			if i & 1:
				asum -= i
				break
	stdout.write(str(asum))
main()


def solve(n, a):
	nodds = 0
	last_odd = -1
	s = 0
	a.sort()
	for i in range(n - 1, -1, -1):
		if a[i] & 1:
			nodds += 1
			last_odd = a[i]
		s += a[i]
	if nodds & 1:
		s -= last_odd
	return s

def main():
	n = int(input())
	a = list(map(int, input().split()))[:n]
	print(solve(n, a))
main()


n = int(input())
a = sorted(list(map(int, input().split())))

def sumch(a):
	s = 0
	a = a
	b = []
	for i in range(len(a)):
		if int(a[i]) % 2 == 0:
			s += a[i]
		else:
			b.append(a[i])
	return (s, b)
(q, w) = sumch(a)
if len(w) % 2 == 0:
	print(sum(w) + q)
else:
	print(sum(w[1:len(w)]) + q)


t = int(input())
l = list(map(int, input().split()))
r = 0
odd = float('+inf')
for i in range(t):
	r += l[i]
	if l[i] % 2 == 1:
		if odd > l[i]:
			odd = l[i]
if r % 2 == 0:
	print(r)
	exit()
elif odd == 0:
	print(0)
	exit()
print(r - odd)


a = input()
x = list(map(int, input().split()))
x.sort()
z = 0
q = sum(x)
while q % 2 != 0:
	q -= x[z]
	if q % 2 == 0:
		break
	else:
		q += x[z]
	z += 1
print(q)


n = int(input())
A = list(map(int, input().split()))
s = sum(A)
if s % 2 == 0:
	print(s)
else:
	A.sort()
	i = 0
	k = True
	while k and i < n:
		if A[i] % 2 != 0:
			print(sum(A) - A[i])
			k = False
		i += 1


n = int(input())
a = list(map(int, input().split()))
a.sort()
res = sum(a)
if res % 2 != 0:
	for i in range(n):
		if a[i] % 2 != 0:
			res -= a[i]
			break
print(res)


n = int(input())
a = list(map(int, input().split()))
sum = 0
odd = []
for i in range(len(a)):
	if a[i] % 2 == 0:
		sum += a[i]
	else:
		odd.append(a[i])
odd.sort(reverse=True)
if len(odd) % 2 == 1:
	odd.remove(odd[-1])
for i in range(len(odd)):
	sum += odd[i]
print(sum)


n = int(input())
lis = sorted(list(map(int, input().split())))
k = sum(lis)
if k % 2 == 0:
	print(k)
else:
	b = 0
	for i in range(n):
		if lis[i] % 2 != 0:
			k = k - lis[i]
			print(k)
			b = 1
			break
	if b == 0:
		print('0')


n = int(input())
m = [int(i) for i in input().split()]
s = 0
t = m[0]
for i in range(n):
	s += m[i]
	if m[i] % 2 == 1 and (m[i] < t or t % 2 == 0):
		t = m[i]
print([s, s - t][s % 2 == 1])


read = lambda : map(int, input().split())
n = int(input())
a = list(read())
ans = sum(a)
if ans % 2:
	Min = 10 ** 10
	for i in range(n):
		if a[i] % 2 and a[i] < Min:
			Min = a[i]
	if Min < 10 ** 10:
		ans -= Min
	else:
		ans = 0
print(ans)


n = int(input())
a = list(map(int, input().split()))
b = 0
a.sort(reverse=True)
for i in range(n):
	b += a[i]
a.sort()
for i in range(n):
	if b % 2 != 0:
		if a[i] % 2 != 0:
			b -= a[i]
	else:
		break
print(b)


n = int(input())
l = list(map(int, input().split()))
o = [i for i in l if i & 1]
o.sort()
e = [i for i in l if not i & 1]
if len(o) & 1:
	print(sum(o) + sum(e) - o[0])
else:
	print(sum(o) + sum(e))


input()
a = list(map(int, input().split(' ')))
oa = list(filter(lambda x: x % 2 == 1, a))
ea = list(filter(lambda x: x % 2 == 0, a))
j = sum(oa) if len(oa) % 2 == 0 else sum(oa) - min(oa)
print(sum(ea) + j)


n = int(input())
o = 0
k = 0
v = []
l = sorted(list(map(int, input().split())))
q = sum(l)
for i in range(n):
	if l[i] % 2 != 0:
		k = l[i]
		o += 1
		v.append(k)
if o % 2 == 0:
	print(q)
else:
	print(q - v[0])


n = int(input())
arr = list(map(int, input().split()))
smallest = 0
total = 0
for i in arr:
	total += i
	if i % 2 and (smallest == 0 or i < smallest):
		smallest = i
if total % 2:
	total -= smallest
print(total)


n = int(input())
a = [int(x) for x in input().split()]
if sum(a) % 2 == 0:
	print(sum(a))
else:
	x = []
	for i in a:
		if i % 2 != 0:
			x.append(i)
	print(sum(a) - min(x))


input()
line = input().split()
line = [int(i) for i in line]
if sum(line) % 2 == 0:
	print(sum(line))
else:
	line.sort()
	for i in line:
		if i % 2 == 1:
			print(sum(line) - i)
			break


n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
sum_ = 0
temp = -1
store = False
for val in l:
	if val % 2 == 0:
		sum_ += val
	elif not store:
		temp = val
		store = True
	else:
		(sum_, store) = (sum_ + temp + val, False)
print(sum_)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	x = min(a)
	if x % 2 == 1:
		print(s - x)
	else:
		a = set(a)
		while min(a) % 2 == 0:
			a.remove(min(a))
		print(s - min(a))


import sys
import math
import bisect
import itertools
import random
import re

def solve(A):
	n = len(A)
	B = []
	C = []
	for a in A:
		if a % 2 == 0:
			B.append(a)
		else:
			C.append(a)
	C.sort(reverse=True)
	if len(C) % 2 == 1:
		C.pop()
	return sum(B) + sum(C)

def main():
	n = int(input())
	A = list(map(int, input().split()))
	print(solve(A))
main()


n = int(input())
x = list(map(int, input().split(' ')))
soma = 0
out = 0
x = sorted(x, reverse=True)
for i in range(n):
	if x[i] % 2 == 0:
		soma += x[i]
	else:
		out += x[i]
		if out % 2 == 0:
			soma += out
			out = 0
print(soma)


input()
l = input().split(' ')
nl = [int(a) for a in l]
nl.sort()
sdfffs = [a for a in nl if a % 2 == 1]
s = sum(nl)
if s % 2 == 1:
	s = s - sdfffs[0]
print(s)


n = int(input())
a = list(map(int, input().split()))
sa = sum(a)

def smallestOdd(a):
	a.sort()
	for e in a:
		if e % 2 == 1:
			return e
if sa % 2 == 0:
	print(sa)
else:
	print(sa - smallestOdd(a))


x = int(input())
l = list(map(int, input().split()))
t = 0
k = 0
l1 = []
for i in range(x):
	if l[i] % 2 == 1:
		t = t + 1
		l1.append(l[i])
l1.sort()
for j in range(x):
	if l[j] % 2 == 0:
		k = k + l[j]
if t % 2 == 1:
	ods = sum(l1[1:])
else:
	ods = sum(l1)
print(ods + k)


n = eval(input())
x = list(map(int, input().split()))
i = 0
y = []
s = 0
o = 0
e = 0
while i < n:
	if x[i] % 2 == 0:
		s += x[i]
	else:
		y += [x[i]]
		o += x[i]
	i += 1
if len(y) % 2 == 0:
	r = s + o
else:
	i = 0
	y.sort(reverse=True)
	while i < len(y) - 1:
		e += y[i]
		i += 1
	r = s + e
print(r)


n = int(input())
numbers = sorted(list(map(int, input().split())))
s = sum(numbers)
if s % 2 != 0:
	for n in numbers:
		if n % 2 != 0:
			break
	s -= n
print(s)


n = int(input())
l = list(map(int, input().split()))
if len(l) == 1:
	if l[0] % 2 == 0:
		print(l[0])
	else:
		print(0)
else:
	su = sum(l)
	l.sort()
	if su % 2 == 0:
		print(su)
	else:
		i = 0
		while i < len(l):
			if l[i] % 2 == 1:
				su -= l[i]
				break
			i += 1
		print(su)


__author__ = 'ibert13'
n = input()
a = list(map(int, input().split()))
nechotnie = sorted([x for x in a if x % 2 > 0])
if sum(a) % 2 > 0:
	answer = sum(a) - nechotnie[0]
else:
	answer = sum(a)
print(answer)


import sys
n = int(input())
a = input().split(' ')
small_odd = sys.maxsize
odd_count = 0
for i in range(n):
	a[i] = int(a[i])
	if a[i] % 2 == 1:
		odd_count += 1
		if a[i] < small_odd:
			small_odd = a[i]
result = sum(a)
if odd_count % 2 == 1:
	result -= small_odd
print(result)


n = int(input())
arr = list(map(int, input().split()))[:n]
odd = 0
even = 0
cnt = 0
minn = 100000000000000000
for i in range(n):
	if arr[i] & 1:
		odd += arr[i]
		cnt += 1
		minn = min(minn, arr[i])
	else:
		even += arr[i]
if cnt & 1:
	odd -= minn
print(odd + even)


import time
n = int(input())
a = [int(i) for i in input().split()]
start = time.time()
b = []
c = []
for i in a:
	if i % 2 == 0:
		b.append(i)
	else:
		c.append(i)
c = sorted(c)
ans = sum(b)
if len(c) % 2 == 0:
	ans += sum(c)
else:
	ans += sum(c[1:])
print(ans)
finish = time.time()


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
res = x = 0
od = 0
for item in a:
	if item % 2 != 0:
		od += 1
		if od % 2 == 0:
			res += item
			res += x
		else:
			x = item
	else:
		res += item
print(res)


a = int(input())
t = list(map(int, input().split()))
t.sort()
p = sum(t)
if len(t) == 1:
	if p % 2 == 0:
		print(p)
	else:
		print(0)
elif p % 2 == 0:
	print(p)
else:
	s = 0
	for j in range(a):
		if (p - t[j]) % 2 == 0:
			print(p - t[j])
			s += 1
			break
	if s == 0:
		print(0)


n = eval(input())
suma = 0
i = 0
j = 0
lista = []
mini = 10 ** 9
k = [int(n) for n in input().split()]
lista = lista + k
while i < len(lista):
	if lista[i] % 2 == 1:
		if lista[i] < mini:
			mini = lista[i]
	i += 1
while j < len(lista):
	suma = suma + lista[j]
	j += 1
if suma % 2 == 1:
	suma = suma - mini
print(suma)


n = int(input())
num = list(map(int, input().split()))
n = len(num)
odd = 0
sum = 0
for i in range(n):
	odd += 1 if num[i] % 2 == 1 else 0
	sum += num[i]
if odd % 2 == 1:
	min = 1000000000
	for i in range(n):
		if num[i] % 2 == 1 and num[i] < min:
			min = num[i]
	sum -= min
print(sum)


n = int(input())
arr = [int(i) for i in input().split(' ')]
sum = sum(arr)
if sum % 2 == 0:
	print(sum)
	exit()
arr.sort()
for i in range(n):
	if arr[i] % 2 == 1:
		print(sum - arr[i])
		break


n = int(input())
l = list(map(int, input().split(' ')))
l.sort()
even = 0
odd = 0
a = 0
e = list()
o = list()
for i in range(0, n):
	if l[i] % 2 == 0:
		even = even + 1
		e.append(l[i])
	else:
		odd = odd + 1
		o.append(l[i])
if sum(e) > sum(o):
	n = len(o)
	if n % 2 == 0:
		a = sum(e) + sum(o)
	else:
		a = sum(e) + sum(o) - o[0]
elif sum(o) >= sum(e) and sum(o) % 2 == 0:
	a = sum(e) + sum(o)
elif sum(o) >= sum(e) and sum(o) % 2 != 0:
	a = sum(e) + sum(o) - o[0]
print(a)


__author__ = 'artyom'

def main():
	n = read()
	s = 0
	m = 1000000001
	for v in read(3):
		s += v
		if v & 1 == 1 and v < m:
			m = v
	if s & 1 == 1:
		s -= m
	return s

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
res = main()
write(res)


n = int(input())
l = list(map(int, input().split()))
l = sorted(l)[::-1]
e = []
o = []
for i in l:
	if i % 2 == 0:
		e.append(i)
	else:
		o.append(i)
s = sum(l)
if s % 2 == 0:
	print(s)
else:
	print(s - min(o))


n = int(input())
inputArray = [int(x) for x in input().split(' ') if x != '']
evenList = [x for x in inputArray if x % 2 == 0]
oddList = sorted([x for x in inputArray if x % 2 == 1])
result = sum(inputArray) - (oddList[0] if len(oddList) % 2 == 1 else 0)
print(result)


n = int(input())
l = input().split()
l_odd = []
sum = 0
for i in l:
	sum += int(i)
	if int(i) % 2 == 1:
		l_odd.append(int(i))
if sum % 2 == 0:
	print(sum)
else:
	l_odd.sort()
	print(sum - l_odd[0])


N = int(input())
a = list(map(int, input().split()))
a.sort()
sm = sum(a)
if sm % 2 == 0:
	print(sm)
else:
	for ax in a:
		if ax % 2 != 0:
			sm -= ax
			break
	else:
		sm = 0
	print(sm)


n = int(input())
numbers = (int(i) for i in input().split(' '))
result = 0
min_odd = None
count_odd = 0
for num in numbers:
	result += num
	if num % 2 != 0:
		count_odd += 1
		if min_odd is None:
			min_odd = num
		if min_odd is not None and num < min_odd:
			min_odd = num
if count_odd % 2 != 0:
	result -= min_odd
print(result)


n = int(input())
a = list(map(int, input().split()))
even = []
odd = []
for x in a:
	if x % 2 == 0:
		even.append(x)
	else:
		odd.append(x)
ans = sum(even)
if len(odd) % 2 == 0:
	ans += sum(odd)
else:
	ans += sum(odd) - min(odd)
print(ans)


n = int(input())
mas = input().split()
mas = [int(x) for x in mas]
mas.sort()
s = sum(mas)
a = 1
for i in range(n + 1):
	if s % 2 == 0:
		print(s)
		a = 0
		break
	elif mas[i] & 1:
		s -= mas[i]
if a:
	print(0)


(n, a) = (int(input()), [int(i) for i in input().split()])
print(sum(a) - min([i if i % 2 else int(10000000000.0) for i in a]) if sum(a) % 2 else sum(a))


n = int(input())
a = [*map(int, input().split())]
print(sum(a) if sum(a) % 2 == 0 else sum(a) - min([*filter(lambda x: x % 2 == 1, a)]))


n = int(input())
a = sorted(list(map(int, input().split())))
x = 0
s = 0
c = 0
b = []
for i in a:
	if i % 2 == 0:
		x += i
	else:
		b.append(i)
		s += i
		c += 1
if c % 2 == 0:
	print(x + s)
else:
	b.sort()
	print(x + s - b[0])


n = int(input())
a = sorted(list(map(int, input().split())))
s = sum(a)
if s % 2 == 0:
	print(s)
else:
	for v in a:
		if v % 2 > 0:
			print(s - v)
			break


__author__ = 'suvasish'
n = int(input())
lst_n = list(map(int, input().split(' ')))
even = []
odd = []
lst_n.sort()
for i in range(0, n):
	item = lst_n[i]
	if item % 2 == 0:
		even.append(item)
	else:
		odd.append(item)
odd.sort()
ld = len(odd)
os = 0
for j in range(0, ld):
	res = sum(odd)
	if res % 2 != 0:
		del odd[j]
		continue
	os = res
	break
out = sum(even) + os
print(out)


n = int(input())
a = sorted(map(int, input().split()))
sm = sum(a)
if sm % 2 == 0:
	print(sm)
else:
	for i in a:
		if i % 2 != 0:
			print(sm - i)
			exit(0)


n = int(input())
odd = 0
lowest_odd = None
s = 0
for num in map(int, input().split()):
	s += num
	if num % 2 == 1:
		odd += 1
		if lowest_odd is None or num < lowest_odd:
			lowest_odd = num
if odd % 2 == 1:
	print(s - lowest_odd)
else:
	print(s)


x = input()
x = [int(x) for x in input().split()]
e = [y for y in x if y % 2 == 0]
o = [z for z in x if z % 2 == 1]
if len(o) % 2 == 0:
	print(sum(e) + sum(o))
else:
	o.sort()
	print(sum(e) + sum(o[1:]))


n = int(input())
l = sorted(list(map(int, input().split())))
odd = 0
ans = 0
for f in l:
	if f % 2 != 0:
		odd += 1
for f in l:
	if f % 2 == 0:
		ans += f
	elif odd % 2 == 0:
		ans += f
	elif odd == 1:
		continue
	else:
		odd += 1
print(ans)


n = int(input())
odd = []
result = 0
for item in input().split():
	number = int(item)
	if number % 2 == 0:
		result += number
	else:
		odd.append(number)
result += sum(odd)
if len(odd) % 2 != 0:
	odd.sort()
	result -= odd[0]
print(result)


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = 0
b = []
l = 0
for i in range(len(a)):
	if a[i] % 2 == 0:
		k += a[i]
	else:
		k += a[i]
		b.append(i)
		l += 1
if l % 2 == 1:
	print(k - a[b[0]])
else:
	print(k)


import math
import cmath
import string
import sys
import bisect
import ctypes
from queue import Queue, LifoQueue, PriorityQueue
from itertools import permutations, combinations
from collections import deque, Counter
n = int(input())
s = list(map(int, input().split(' ')))
sum = 0
x = []
for i in range(n):
	if s[i] % 2 == 0:
		sum = sum + s[i]
	else:
		x.append(s[i])
		sum += s[i]
k = len(x) - 1
x.sort()
if k % 2 == 0:
	sum -= x[0]
print(sum)


def main():
	input()
	l = list(map(int, input().split()))
	s = sum(l)
	if s & 1:
		l.sort()
		for a in l:
			if a & 1:
				s -= a
				break
		else:
			s = 0
	print(s)
main()


def isOdd(x):
	return x % 2 == 1

def isEven(x):
	return x % 2 == 0
input()
arr = [int(z) for z in input().split()]
oddA = list(filter(isOdd, arr))
oddA.sort()
evenSum = sum(filter(isEven, arr))
if isOdd(len(oddA)):
	print(evenSum + sum(oddA[1:]))
else:
	print(evenSum + sum(oddA))


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
n = iinput()
l = get_list()
ans = sum(l)
l.sort()
if ans % 2 == 0:
	print(ans)
else:
	for item in l:
		if item % 2 == 1:
			ans -= item
			break
	print(ans)


n = int(input())
max_sum = 0
seq_list = list(map(int, input().split()))
odd = 0
min_odd = 9999999999999999
seq_sum = 0
for num in seq_list:
	seq_sum += num
	if num % 2 == 1:
		odd += 1
		if num < min_odd:
			min_odd = num
if odd % 2 == 0:
	print(seq_sum)
else:
	print(seq_sum - min_odd)


n = int(input())
b = [int(i) for i in input().split()]
maxx = 0
summ = 0
sum(b)
c = 0
h = sum(b)
if h % 2 != 0:
	h = h - min([int(i) for i in b if i % 2 != 0])
print(h)


n = int(input())
l = list(map(int, input().split()))
k = 0
l = sorted(l)
for i in range(n):
	k = k + l[i]
if k % 2 == 0:
	print(k)
else:
	for i in range(n):
		if l[i] % 2 != 0:
			k = k - l[i]
			break
	print(k)


n = int(input())
a = [int(x) for x in input().split(' ')]
e = [x for x in a if x % 2 == 0]
o = [x for x in a if x % 2 == 1]
if len(o) == 0:
	ans = sum(e)
else:
	ans = sum(e) + sum(o) - len(o) % 2 * min(o)
print(ans)


n = int(input())
al = list(map(int, input().split()))
ol = []
ans = 0
for a in al:
	if a % 2 > 0:
		ol += [a]
ans = sum(al)
x = len(ol)
if x > 0 and x % 2 == 1:
	ans -= min(ol)
print(ans)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
S = set(l)
l1 = list(S)
if s % 2 == 0:
	print(s)
else:
	while True:
		M = min(l1)
		if M % 2 == 0:
			l1.remove(min(l1))
		else:
			break
	print(s - M)


n = int(input())
data = list(map(int, input().split()))
odd = []
sum = 0
for num in data:
	if num % 2 == 0:
		sum += num
	else:
		odd.append(num)
odd.sort()
for num in odd:
	sum += num
if len(odd) % 2 == 1:
	sum -= odd[0]
print(sum)


n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
	sum += int(i)
if sum % 2 == 0:
	print(sum)
else:
	minn = int(1000000000000000)
	for i in a:
		if i % 2:
			minn = min(minn, i)
	sum = sum - minn
	print(sum)


(a, b, c, t) = (input(), list(map(int, input().split())), 10 ** 9, 0)
for i in b:
	if i % 2:
		c = min(c, i)
		t = [0, 1][[0, 1].index(t) - 1]
print(sum(b) - c if t else sum(b))


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
sm = sum(a)
for num in a:
	if num % 2 == 1 and sm % 2 == 1:
		sm -= num
print(sm)


nr_of_ints = int(input())
raw_ints = input()
ints = list(map(int, raw_ints.split(' ')))
min_odd = 10 ** 9 + 1
sum = 0
for x in range(nr_of_ints):
	sum += ints[x]
	if ints[x] % 2:
		min_odd = min(min_odd, ints[x])
if sum % 2:
	sum -= min_odd
print(sum)


input()
x = list(map(int, input().split(' ')))
x = sorted(x)
SUM = sum(x)
if SUM % 2 == 0:
	print(SUM)
	exit()
for i in range(len(x)):
	if x[i] % 2 != 0:
		print(SUM - x[i])
		exit()


n = int(input())
numbers = list(map(int, input().split()))
numbers_sum = sum(numbers)
print(numbers_sum - min(filter(lambda x: x % 2, numbers)) if numbers_sum % 2 else numbers_sum)


n = int(input().strip())
arr = list(map(int, input().strip().split()))
odds = []
s = 0
for i in arr:
	if i % 2 != 0:
		odds.append(i)
	else:
		s += i
if len(odds) % 2 == 0:
	s += sum(odds)
else:
	odds.sort(reverse=True)
	s += sum(odds[:-1])
print(s)


n = int(input())
v = list(map(int, input().split()))
(chet, nechet) = ([], [])
sum_nechet = 0
for i in v:
	if i % 2 == 0:
		chet.append(i)
	else:
		nechet.append(i)
sum_chet = sum(chet)
if len(nechet) % 2 == 0:
	sum_nechet = sum(nechet)
else:
	nechet.remove(min(nechet))
	sum_nechet = sum(nechet)
print(sum_chet + sum_nechet)


n = int(input())
m = list(map(int, input().split()))
last = 0
s = sum(m)
if s % 2 == 0:
	print(s)
else:
	for i in range(n):
		if m[i] % 2 != 0:
			if s - m[i] > last:
				last = s - m[i]
	print(last)


n = input()
split = input().split()
numbers = list(map(lambda x: int(x), split))
_min = 10000000000
sum = 0
for n in numbers:
	sum += n
	if n < _min and n % 2 != 0:
		_min = n
if sum % 2 == 0:
	print(sum)
else:
	sum -= _min
	print(sum)


def solution(inputList):
	n = len(inputList)
	sum = 0
	for i in range(n):
		sum += int(inputList[i])
	if sum % 2 == 0:
		outputs = sum
	else:
		l = []
		for i in range(n):
			temp = int(inputList[i])
			if temp % 2 != 0:
				l.append(temp)
		outputs = sum - min(l)
		outputs
	return outputs
n = int(input())
inputList = list(input().split())
output = solution(inputList)
print(output)


n = int(input())
arr = list(map(int, input().split()))
sumx = 0
even = 0
odd = 0
mini = 1000000001
for x in arr:
	if x % 2 == 0:
		even += 1
	else:
		odd += 1
		mini = min(mini, x)
	sumx += x
if sumx % 2 == 0:
	print(sumx)
else:
	print(sumx - mini)


n = int(input())
m = list(map(int, input().split()))
a = 0
b = 0
c = []
for i in m:
	if i % 2 == 0:
		a += i
	else:
		b += i
		c.append(i)
if b % 2 != 0:
	b = b - min(c)
print(a + b)


a = int(input())
l = list(map(int, input().split()))
(k, s) = ([], 0)
for x in l:
	if x % 2 == 0:
		s += x
	else:
		k.append(x)
if len(k) % 2 == 1:
	k.sort()
	s += sum(k) - k[0]
else:
	s += sum(k)
print(s)


n = int(input())
l = list(map(int, input().split()))
a = []
b = []
if sum(l) % 2 == 0:
	print(sum(l))
else:
	for i in l:
		if i % 2 == 0:
			a.append(i)
		else:
			b.append(i)
	b.sort()
	print(sum(a) + sum(b[1:]))


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
A = [int(x) for x in input().split()]
odds = [x for x in A if x % 2 == 1]
evens = [x for x in A if x % 2 == 0]
ans = sum(evens or [0])
if odds:
	odds.sort()
	os = sum(odds)
	if os % 2 == 1:
		os -= odds[0]
	ans += os
print(ans)


n = int(input())
s = input().split()
k = 0
for i in range(n):
	k += int(s[i])
if k % 2 == 0:
	print(k)
else:
	lish = 0
	for i in range(n):
		if int(s[i]) % 2 != 0:
			lish = int(s[i])
			break
	for i in range(n):
		if int(s[i]) % 2 != 0 and int(s[i]) < lish:
			lish = int(s[i])
	k = k - lish
	print(k)


n = int(input())
ar = list(map(int, input().split()))
odd = 0
k = 0
t = 0
for i in ar:
	if i % 2 != 0:
		odd += 1
ar = sorted(ar)
for i in range(n):
	if ar[i] % 2 != 0:
		k = ar[i]
		break
if odd % 2 != 0:
	t = sum(ar) - k
else:
	t = sum(ar)
print(t)


n = int(input())
a = [int(i) for i in input().split()]
s = 0
b = []
for i in a:
	if i > 0:
		if i % 2:
			b += [i]
		else:
			s += i
if len(b) % 2:
	s += sum(b) - min(b)
else:
	s += sum(b)
print(s)


n = int(input())
nums = [int(num) for num in input().split()]
odds = []
for num in nums:
	if num % 2:
		odds.append(num)
if len(odds) % 2:
	print(sum(nums) - min(odds))
else:
	print(sum(nums))


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def main():
	n = int(input())
	a = get_array()
	a.sort()
	z = sum(a)
	if z % 2 == 0:
		print(z)
	else:
		for i in a:
			if i % 2 != 0:
				z = z - i
				break
		print(z)
main()


n = int(input())
data = list(map(int, input().split()))
sum = 0
odd = 0
tmp = 100000000000
for d in data:
	sum += d
	if d % 2 == 1:
		odd += 1
		if d < tmp:
			tmp = d
if odd % 2 == 1:
	sum -= tmp
print(sum)


_ = int(input())
nums = list(map(int, input().split()))
s = sum(nums)
nums.sort()
if s % 2 == 0:
	print(s)
else:
	for r in range(0, len(nums)):
		if nums[r] % 2 != 0:
			print(s - nums[r])
			break
	else:
		print(0)


import math
n = int(input())
a = [int(i) for i in input().split()]
s = 0
o = math.inf
for i in a:
	s += i
	if i % 2 != 0:
		if i < o:
			o = i
if s % 2 == 0:
	print(s)
else:
	print(s - o)


n = int(input())
a = list(map(int, input().split()))
b = sum(a)
a.sort()
c = 0
for i in a:
	if i % 2 != 0:
		c += i
		break
if b % 2 != 0:
	b -= c
	print(b)
else:
	print(b)


count = int(input())
(total, smallest) = (0, 10 ** 9)
numbers = map(int, input().split())
for x in numbers:
	if x < smallest and x % 2:
		smallest = x
	total += x
if total % 2 == 0:
	print(total)
else:
	print(total - smallest)


def main():
	n = int(input())
	arr = [int(t) for t in input().split()]
	s = 0
	mini = 10000000000
	for item in arr:
		s += item
		if item % 2 != 0 and item < mini:
			mini = item
	if s % 2 == 0:
		print(s)
	else:
		print(s - mini)
main()


n = int(input())
li = list(map(int, input().split()))
li.sort(reverse=True)
odd = [i for i in li if int(i) % 2 != 0]
x = len(odd)
if x % 2 != 0:
	y = odd[-1]
	li.remove(y)
print(sum(li))


n = int(input())
X = [int(x) for x in input().split(' ')]
i = 0
p = []
q = []
for i in range(n):
	if X[i] % 2 == 0:
		p.append(X[i])
	if X[i] % 2 != 0:
		q.append(X[i])
p.sort()
q.sort()
q.extend(p)
for i in range(n):
	if sum(q) % 2 == 0:
		print(sum(q))
		break
	else:
		q.pop(i)
else:
	print(0)


input()
s = 0
i = 0
L1 = []
for k in input().split(' '):
	if int(k) % 2 == 0:
		s += int(k)
	else:
		L1.append(int(k))
		i += 1
L1 = sorted(L1, reverse=True)
for k in range(0, i - 1, 2):
	s += L1[k] + L1[k + 1]
print(s)


nextInts = lambda : map(int, input().split())
n = input()
a = list(nextInts())
ret = sum(a)
if ret & 1:
	ret -= min([x for x in a if x & 1])
print(ret)


n = int(input())
s = 0
a = [int(i) for i in input().split()]
f = 0
a = sorted(a)
for i in a:
	s += i
	if i % 2 == 1:
		f += 1
if f % 2 == 0:
	print(s)
	exit(0)
for i in a:
	if i % 2 == 1:
		s -= i
		break
print(s)


def akula(lst):
	(odd, even) = (list(), list())
	for elem in lst:
		if elem % 2 == 0:
			even.append(elem)
		else:
			odd.append(elem)
	odd = sorted(odd)
	return sum(even) + sum(odd[len(odd) % 2:])
n = int(input())
a = [int(i) for i in input().split()]
print(akula(a))


n = int(input())
l = list(map(int, input().split()))
even = list(filter(lambda x: x % 2 == 0, l))
odd = list(filter(lambda x: x % 2 != 0, l))
total = 0
total = sum(even)
odd.sort()
if len(odd) % 2 == 0:
	total += sum(odd)
else:
	odd.remove(odd[0])
	total += sum(odd)
print(total)


n = int(input())
a = list(map(int, input().split()))
c = []
d = []
for i in a:
	if i % 2 == 0:
		c.append(i)
	else:
		d.append(i)
d.sort(reverse=True)
if len(d) % 2 != 0:
	d.pop()
print(sum(c + d))


input()
a = list(sorted(list(map(int, input().split()))))
counter = 0
bool = 0
for i in a:
	if i % 2 != 0:
		if bool == 0:
			x = a.index(i)
			bool = 1
		counter += 1
if counter % 2 == 0:
	print(sum(a))
else:
	a.pop(x)
	print(sum(a))


import sys
n = int(input())
a = list(map(int, input().split()))
cnt = 0
last = -1
ans = 0
for i in range(n):
	if a[i] % 2:
		if a[i] < last or last == -1:
			last = a[i]
		cnt += 1
		ans += a[i]
	else:
		ans += a[i]
if cnt % 2:
	ans -= last
print(ans)


n = int(input())
l = map(int, input().split())
l = sorted(l)
s = sum(l)
if s % 2 == 1:
	for i in l:
		if i % 2 == 1:
			s -= i
			break
print(s)


x = int(input())
smallodd = 9999999999999999999999999999
sumodd = 0
sumeven = 0
l = list(map(int, input().split()))
for i in range(x):
	y = l[i]
	if y % 2 == 1 and y < smallodd:
		smallodd = y
	if y % 2 == 1:
		sumodd += y
	else:
		sumeven += y
if sumodd % 2 == 1:
	sumodd -= smallodd
sum = sumodd + sumeven
print(sum)


n = int(input())
l = list(map(int, input().split()))
even = []
odd = []
s = 0
for i in l:
	if i % 2 == 0:
		even.append(i)
	else:
		odd.append(i)
odd.sort()
s += sum(even) + sum(odd)
if len(odd) % 2 != 0:
	s -= odd[0]
print(s)


n = int(input())
numbers = list(map(int, input().split()))[:n]
even = []
odd = []
for i in numbers:
	if i % 2 == 0:
		even.append(i)
	else:
		odd.append(i)
if len(even) == 0:
	even_sum = 0
else:
	even_sum = sum(even)
odd = sorted(odd, reverse=True)
if len(odd) == 0:
	odd_sum = 0
elif len(odd) % 2 == 0:
	odd_sum = sum(odd)
else:
	odd_sum = sum(odd[:len(odd) - 1])
print(even_sum + odd_sum)


def big_boi_sum(arr):
	ini = sum(arr)
	if ini % 2 == 0:
		return ini
	eve = []
	odd = []
	for i in arr:
		if i % 2 == 0:
			eve.append(i)
		else:
			odd.append(i)
	if sum(odd) % 2 != 0:
		odd.remove(min(odd))
	fin = sum(eve + odd)
	return fin
n = int(input())
arr = list(map(int, input().rstrip().split()))
print(big_boi_sum(arr))


a = input()
tmp = input()
str_list = tmp.split()
num_list = [int(i) for i in str_list]
num_list.sort()
sum_list = 0
for i in num_list:
	sum_list += i
if sum_list % 2 == 0:
	print(sum_list)
else:
	for i in num_list:
		if i % 2 == 1:
			sum_list -= i
			break
	print(sum_list)


import math
n = int(input())
a = [int(i) for i in input().split(' ')]
a.sort()
s = 0
for i in range(n):
	s += a[i]
if s & 1 == 0:
	print(s)
else:
	for i in range(n):
		if a[i] & 1 == 1:
			s -= a[i]
			print(s)
			break


n = int(input())
ps = []
ptu = []
l = map(int, input().split())
for i in l:
	if i % 2 == 0:
		ps.append(i)
	else:
		ptu.append(i)
ptu.sort()
if len(ptu) % 2 == 1:
	ptu.pop(0)
print(sum(ptu) + sum(ps))


n = input()
n = int(n)
num = list(map(int, input().strip().split()))
num.sort()
sum = 0
for i in num:
	sum = sum + i
if sum % 2 == 1:
	for i in num:
		if i % 2 == 1:
			sum -= i
			break
print(sum)


n = eval(input())
l = input()
l = str(l)
a = [0] * n
i = len(l) - 1
d = 1
s = 0
j = 0
su = 0
while i >= 0:
	while l[i] != ' ' and i >= 0:
		t = int(l[i])
		s += t * d
		d *= 10
		i -= 1
	a[j] = s
	i -= 1
	j += 1
	d = 1
	s = 0
j = 0
while j < n:
	su += a[j]
	j += 1
if su % 2 == 0:
	print(su)
else:
	j = 0
	min = 10 ** 9 + 1
	while j < n:
		if a[j] < min and a[j] % 2 != 0:
			min = a[j]
		j += 1
	print(su - min)


n = int(input())
a = list(map(int, input().split()))
counter = 0
min_p = 10 ** 10
sumy = 0
for i in range(n):
	if a[i] % 2 == 1:
		counter += 1
		min_p = min(min_p, a[i])
	sumy += a[i]
if counter % 2 == 1:
	sumy -= min_p
print(sumy)


n = int(input())
l = [*map(int, input().split())]
Sum = sum(l)
Odd = 0
Min_O = float('inf')
for i in range(n):
	if l[i] % 2 != 0:
		Odd += 1
		if l[i] < Min_O:
			Min_O = l[i]
print(Sum if Odd % 2 == 0 else Sum - Min_O)


def solve(arr, n):
	arr = sorted(arr)
	res = sum(arr)
	if res % 2 == 0:
		return res
	for i in range(n):
		if arr[i] % 2 != 0:
			res -= arr[i]
		if res % 2 == 0:
			return res
	return 0

def main():
	n = int(input())
	arr = list(map(int, input().split(' ')))
	print(solve(arr, n))
main()


def max_even_sum(numbers):
	s = sum(numbers)
	nodd = sum((n % 2 for n in numbers))
	if nodd % 2:
		s -= min((n for n in numbers if n % 2))
	return s
n = int(input())
numbers = list(map(int, input().split()))
assert len(numbers) == n
print(max_even_sum(numbers))


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
if sum(arr) % 2 == 0:
	print(s)
else:
	for i in sorted(arr):
		if i % 2 != 0:
			print(s - i)
			exit()


n = int(input())
l = sorted(map(int, input().split()))
su = sum(l)
if su % 2 == 0:
	print(su)
else:
	for i in range(n):
		if l[i] % 2 == 1:
			print(su - l[i])
			break
	else:
		print(0)


def main():
	n = int(input())
	l = list(map(int, input().split()))
	ans = sum(l)
	(mn, oddcnt) = (int(1000000000.0), 0)
	for i in l:
		if i & 1:
			oddcnt += 1
			mn = min(mn, i)
	if oddcnt & 1:
		ans -= mn
	print(ans)
main()


n = int(input())
l = list(map(int, input().split()))
l.sort()
b = sum(l)
chet = []
nechet = []
for i in range(len(l)):
	if l[i] % 2 == 0:
		chet.append(l[i])
	else:
		nechet.append(l[i])
	if b % 2 != 0 and len(nechet) != 0:
		b = sum(l) - nechet[0]
print(b)


n = int(input())
a = list(map(int, input().split()))
a.sort()

def fn(a, n):
	ans = sum(a)
	if ans % 2 == 0:
		return ans
	else:
		for i in range(n):
			if a[i] % 2 != 0:
				ans -= a[i]
				return ans
print(fn(a, n))


import sys
n = int(input())
list1 = [int(x) for x in input().split()]
list1.sort()
x = sum(list1)
if x % 2 == 0:
	print(x)
	sys.exit(0)
else:
	for i in list1:
		if i % 2 == 1:
			print(x - i)
			break


n = int(input())
sumEven = 0
total = 0
uneven = []
for i in input().split():
	if int(i) % 2 == 0:
		sumEven = sumEven + int(i)
	else:
		uneven.append(int(i))
if len(uneven) % 2 == 0:
	total = sum(uneven) + sumEven
else:
	uneven = sorted(uneven, reverse=True)
	total = sum(uneven[:-1]) + sumEven
print(total)


n = int(input())
arr = list(map(int, input().split()))
total = 0
minimumOdd = 1000000001
for i in range(n):
	temp = arr[i]
	total += temp
	if temp % 2 != 0:
		if temp < minimumOdd:
			minimumOdd = temp
if total % 2 == 0:
	print(total)
else:
	print(total - minimumOdd)


n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
b = []
for i in range(n):
	s += a[i]
j = 0
try:
	while len(b) < 2 and j < len(a):
		if a[j] % 2 == 1:
			b.append(a[j])
		j += 1
	if s % 2 == 1:
		s -= min(b)
	print(s)
except:
	print(0)


n = int(input())
k = list(map(int, input().split()))
s = 0
smin = 10000000000
if sum(k) % 2 == 0:
	print(sum(k))
else:
	for i in range(n):
		if k[i] % 2 != 0 and k[i] < smin:
			smin = k[i]
	s = sum(k) - smin
	print(s)


n = int(input())
num = input().split()
num = [int(x) for x in num]
num = sorted(num)
impar1 = None
p = 0
soma = 0
while p < n and num[p] % 2 == 0:
	soma += num[p]
	p += 1
if p < n:
	impar1 = num[p]
	while p < n:
		soma += num[p]
		p += 1
if soma % 2 == 1:
	soma -= impar1
print(soma)


n = int(input())
a = list(map(int, input().split()))
odd = 0
for i in range(n):
	if a[i] % 2 == 1:
		odd += 1
odd = odd - odd % 2
summa = 0
a.sort()
for i in range(n - 1, -1, -1):
	if a[i] % 2 == 0:
		summa += a[i]
	elif odd > 0:
		summa += a[i]
		odd -= 1
print(summa)


def wet_shark_and_odd_and_even():
	odd = []
	even = []
	odd_cnt = 0
	n = input()
	numbers = list(map(int, input().split()))
	for number in numbers:
		if number % 2 == 0:
			even.append(number)
		else:
			odd.append(number)
			odd_cnt += 1
	odd.sort()
	k = int(odd_cnt / 2) * 2
	if k > 0:
		summe = sum(even) + sum(odd[-k:])
	else:
		summe = sum(even)
	print(summe)
	return
wet_shark_and_odd_and_even()


def wet_shark(a):
	sum = 0
	a.sort()
	for i in range(len(a)):
		sum += a[i]
	if sum % 2 == 0:
		print(sum)
	else:
		i = 0
		while sum % 2 != 0:
			sum = sum - a[i]
			if sum % 2 != 0:
				sum += a[i]
			i = i + 1
		print(sum)
n = int(input(''))
a = list(map(int, input('').split()))
wet_shark(a)


n = int(input())
s = str(input()).split()
tot = 0
si = 0
m = -1
for i in range(n):
	x = int(s[i])
	if int(x) % 2 == 0:
		tot += x
	elif m == -1:
		m = x
	elif x < m:
		si += m
		m = x
	else:
		si += x
if si % 2 == 0:
	tot += si
else:
	tot += si + m
print(tot)


n = int(input())
t = list(map(int, input().split()))
t.sort()
extdig = 0
digsum = sum(t)
if digsum % 2 == 0:
	print(digsum)
else:
	for i in range(n):
		if t[i] % 2 == 1:
			extdig = t[i]
			break
	print(digsum - extdig)