- Time limit: 0.50 s
- Memory limit: 128 MB
Calculate the sum of n numbers.
Input
The first line of input consists of a single integer n. The second line contains n space separated integers a_1,a_2,\ldots,a_n.
Output
Output the sum of integers a_1,a_2,\ldots,a_n.
Constraints
- 1 \le n \le 10^6
- -10^9 \le a_i \le 10^9
Example
Input:
5 2 1 -3 5 8
Output:
13
Input:
6 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
Output:
6000000000
Remark
The answer might not fit in a 32-bit integer. You might want to use a bigger type (long long
in C++ and long
in Java).
The input is very big, so you have to read it efficiently. See the instructions.