Long ago, in the ancient kingdom of Numaria, King Numerion had n treasure chests. Each chest contained a certain number of gold coins.
On the night before the annual festival, the king wanted to know how rich he truly was. He asked you, his royal scribe, to calculate the total number of coins in all the treasure chests.
Given an integer n and n integers representing the number of coins in each chest, print the sum of all coins.
The first line contains a single integer n — the number of treasure chests.
The second line contains n space-separated integers a1, a2, ..., an — the number of coins in each chest.
Print a single integer: the total number of coins.
5 10 20 30 40 50
150
Constraints:
Long ago, in the ancient kingdom of Numaria, King Numerion had n treasure chests. Each chest contained a certain number of gold coins.
On the night before the annual festival, the king wanted to know how rich he truly was. He asked you, his royal scribe, to calculate the total number of coins in all the treasure chests.
Given an integer n and n integers representing the number of coins in each chest, print the sum of all coins.
The first line contains a single integer n — the number of treasure chests.
The second line contains n space-separated integers a1, a2, ..., an — the number of coins in each chest.
Print a single integer: the total number of coins.
5 10 20 30 40 50
150
Constraints: