Sum of Array

easy implementation math 1000 ms · 256 MB

Sum of Array

You are given an array of n integers. Print their sum.

Input

The first line contains a single integer n (1 ≤ n ≤ 2·10^5).

The second line contains n integers a_1, a_2, …, a_n (-10^9 ≤ a_i ≤ 10^9).

Output

Print the sum of the array.

Notes

The answer may not fit in a 32-bit integer.

Example 1

Input

5
1 2 3 4 5

Output

15

Example 2

Input

3
-1000000000 -1000000000 7

Output

-1999999993

Hints · reveal one at a time if you're stuck

Hint 1

The sum can get much larger than any single input value. Work out the largest possible total from the constraints before choosing how to store it.

Hint 2

Read the numbers one at a time and keep a running total. Make sure the variable holding the total is a 64-bit integer.

report an issue Prefer your own editor? sooks prep 1 (CLI)
Sign in to run code

Run your code on the examples, or submit it against every test.