Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-toq-elementlar-yigindisi

Sum of odd elements

Easy 1000 ms 128 MB 22%
Share

A positive integer $n$ and an array of $n$ integers are given. Compute the sum of all array elements with odd values.

Computing the sum of the odd array elements

Input

The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.

Output

One integer — the sum of the odd elements ($0$ if there are none).

Note

$1 \le n \le 1000$
$-10^{8} \le a_{i} \le 10^{8}$

Examples

Input #1
5
3 4 7 8 5
Output #1
15
Input #2
4
2 4 6 8
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.