#K2781. Sum of Even Numbers

    ID: 24813 Type: Default 1000ms 256MiB

Sum of Even Numbers

Sum of Even Numbers

You are given an array of integers. Your task is to calculate the sum of all even numbers in the array. If the array is empty, the output should be 0.

Note: An even number is an integer that is divisible by 2 without a remainder.

The input is provided via standard input and the result must be printed to standard output.

inputFormat

The first line contains an integer n which indicates the number of elements in the array. The second line contains n space-separated integers.

outputFormat

Output a single integer representing the sum of all even numbers in the array.

## sample
4
2 4 6 8
20