#C13086. Sum of Even Numbers

    ID: 42585 Type: Default 1000ms 256MiB

Sum of Even Numbers

Sum of Even Numbers

Given an array of integers, your task is to compute the sum of all even numbers in the array. If there are no even numbers, output 0.

The formula used is: \(S = \sum_{i=1}^{n} \text{if }a_i \mod 2 = 0 \text{ then } a_i\), where \(a_i\) represents each element in the array.

You are required to read the input from standard input (stdin) and print the result to standard output (stdout).

inputFormat

The first line contains a single integer \(n\) representing the number of elements in the array.

The second line contains \(n\) integers separated by spaces.

outputFormat

Output a single integer, which is the sum of all even numbers in the array.

## sample
5
2 4 6 8 10
30