This page is still under construction.

Parts of this page are still being built. What you see may change.

Sum of N integers

Time limit0.1sMemory limit512 MB

Summary
Read N integers and print their sum, which needs a 64-bit integer type.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

You are given NN integers. Write a program that computes the sum of those NN integers.

When NN and every integer are at their largest, the sum is 3,000,000,000,0003{,}000{,}000{,}000{,}000, so a 32-bit integer type cannot hold the answer. Use a 64-bit integer type.

Input

The first line has the number of integers NN (1≤N≤3,000,0001 \le N \le 3{,}000{,}000).

The second line has the NN integers, separated by single spaces. Each integer is between 00 and 1,000,0001{,}000{,}000.

Output

Print the sum of the given NN integers on the first line.

Examples4

  1. Example 1

    Input
    1
    0
    
    Expected output
    0
    
  2. Example 2

    Input
    5
    1 2 3 4 5
    
    Expected output
    15
    
  3. Example 3

    Input
    3
    1000000 1000000 1000000
    
    Expected output
    3000000
    
  4. Example 4

    Input
    10
    0 1000000 0 1000000 0 1000000 0 1000000 0 1000000
    
    Expected output
    5000000