#C6112. Total Skyline Area

    ID: 49837 Type: Default 1000ms 256MiB

Total Skyline Area

Total Skyline Area

Given a sequence of building heights, determine the total area of the skyline when viewed from the side. The area is defined as the sum of the heights of the buildings. In mathematical terms, if the heights are \(h_1, h_2, \dots, h_n\), the total skyline area is \(\sum_{i=1}^{n} h_i\).

For example, if the input list is [1, 3, 2, 5, 4], the total area would be 15.

You are required to write a program that reads the number of buildings followed by the list of building heights from standard input and outputs the total area to standard output.

inputFormat

The first line contains a single integer \(n\) representing the number of buildings. The second line contains \(n\) space-separated integers, where each integer represents the height of a building. If \(n = 0\), no further input is provided.

outputFormat

Output a single integer which is the total area of the skyline.

## sample
1
5
5