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

~/algor $ cat problems/juft-orinlardagi-yigindi

Sum at even positions

Easy 1000 ms 64 MB 29%
Share

A sequence of $n$ integers is given. Find the sum of the numbers at even positions — the $2$nd, $4$th, $6$th, … If there are no such numbers ($n = 1$), the answer is $0$.

The input numbers with their positions; the numbers at even positions are highlighted

Input

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

Output

One integer — the sum.

Note

$1 \le n \le 1000$
the numbers are from $-10^{6}$ to $10^{6}$

Examples

Input #1
5
3 8 -2 4 7
Output #1
12
Input #2
1
9
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.