Attractive Flowers
InterviewTime limit1sMemory limit512 MB
Given the stock of each flower type, pick an odd count from each type so the total is odd and as large as possible.
- Level
Easy3 of 10
- Topics
- Greedy, Math, Implementation
- Solved
- No attempts yet
Problem
Maxim wants to give his girlfriend Ira a bouquet of flowers for her birthday.
The flower shop near his house sells flowers of types. Maxim has found out that the store has flowers of the -th type. He also knows that Ira likes odd numbers. So Maxim has decided that the bouquet must contain an odd number of flowers of each type, and the total number of flowers in the bouquet must also be odd.
Help Maxim find the maximum number of flowers the bouquet can contain.
Input
The first line contains an integer , the number of flower types sold in the store ().
The second line contains integers , the number of flowers of each type ().
Output
Print the maximum number of flowers the bouquet can contain on one line.