#K68917. Calculate Skyline Area
Calculate Skyline Area
Calculate Skyline Area
You are given a sequence of buildings arranged side by side. Each building has a width of 1 and a specified height. The "skyline" is simply the collection of these buildings; its total area is the sum of the heights of the buildings. Mathematically, if the heights are \(h_1, h_2, \ldots, h_n\), then the total area \(A\) is given by:
\(A = \sum_{i=1}^{n} h_i\)
Your task is to compute \(A\) given the heights of the buildings.
inputFormat
The input is given via standard input (stdin) and consists of two lines. The first line contains an integer \(n\) indicating the number of buildings. The second line contains \(n\) space-separated integers representing the height of each building.
For example:
5 1 3 2 4 1
outputFormat
Output via standard output (stdout) a single integer representing the total area of the skyline.
## sample1
5
5