Hide

Problem K
A Terrible Fortress

/problems/aterriblefortress/file/statement/en/img-0001.png
Blaze Rod, Minecraft Wiki

As Steve, Alex, and Kai enter the nether, they wander for what feels like days before finally discovering their goal; a large, imposing fortress looms before them. As they begin to walk the twisting hallways of the fortress, they turn a corner and see a long, straight hallway full of blazes, large floating fiery creatures ready to attack. Luckily, they haven’t been spotted yet, so the three decide to count how many blazes are in the hallway before deciding whether to fight or retreat.

Given a list of blaze counts describing the hallway, print the total number of blazes that are present.

Input

The first line of input contains an integer $1\le n \le 1000$, the length of the hallway. Each of the next $n$ lines contains an integer, $b$, describing the number of blazes in that section of hallway.

Output

Output a single integer, $T$, the total number of blazes across all sections of hallway. It is guaranteed that $T$ won’t exceed $10^9$.

Sample Input 1 Sample Output 1
2
5
10
15
Sample Input 2 Sample Output 2
5
0
0
0
0
0
0

Please log in to submit a solution to this problem

Log in