Under construction

Still being built. Things may change

Junseok's Candy Shopping

Time limit1sMemory limit1024 MB

Summary
Given N bags of candy, find the largest even total you can get by choosing any subset of bags, or 0 if none exists.
Level

Easy2 of 10

Topics
Greedy, Math
Solved
No attempts yet

Problem

Junseok wants to take as many candies as possible from the candy shop for his two younger siblings. The shop has NN bags of candy, and the ii-th bag holds aia_i candies. Junseok is rich, so he can buy as many bags as he wants. However, if the total number of candies he takes is odd, his siblings will fight over who gets one more, so he wants to take an even number of candies. Find the maximum number of candies Junseok can take.

Input

The first line contains the number of bags NN (1≤N≤10001 \leq N \leq 1000). The second line contains a1,a2,⋯ ,aNa_1, a_2, \cdots, a_N (1≤ai≤10001 \leq a_i \leq 1000). All numbers in the input are integers.

Output

Print the maximum number of candies Junseok can take. If he can take candies only in an odd total, print 00.

Examples2

  1. Example 1

    Input
    5
    8 3 6 7 5
    
    Expected output
    26
    
  2. Example 2

    Input
    1
    5
    
    Expected output
    0