33OJ
登录 注册

#ABC479A. 奇数下标求和 / Odd Index Sum

奇数下标求和 / Odd Index Sum

Problem Statement

You are given an integer sequence of length NN: A=(A1,A2,…,AN)A=(A_1,A_2,\dots,A_N). Find the sum of the odd-indexed terms of AA. More formally, find the sum of AiA_i over all odd ii satisfying 1≤i≤N1 \le i \le N.

Constraints

  • All input values are integers.
  • 1≤N≤1001 \le N \le 100
  • 1≤Ai≤1001 \le A_i \le 100

Input

The input is given from Standard Input in the following format:

  • NN
  • A1A_1 A2A_2 …\ldots ANA_N

Output

Output the answer.

5
3 1 4 1 5
12

In this input, A=(3,1,4,1,5)A=(3,1,4,1,5), and the terms to be summed are A1,A3,A5A_1,A_3,A_5. Output their sum, that is, 3+4+5=123+4+5=12.

6
2 7 1 8 2 8
5

In this input, A=(2,7,1,8,2,8)A=(2,7,1,8,2,8), and the terms to be summed are A1,A3,A5A_1,A_3,A_5. Output their sum, that is, 2+1+2=52+1+2=5.

9
100 40 30 50 20 90 100 80 60
310