#K81877. Stack Boxes

    ID: 35851 Type: Default 1000ms 256MiB

Stack Boxes

Stack Boxes

You are given a collection of boxes, where each box has a height represented by an integer. Your task is to determine the maximum possible height when stacking all the boxes. There is no restriction on the order in which the boxes can be stacked; therefore, the maximum height is simply the sum of the individual heights of all the boxes.

Note: If no boxes are provided (i.e. an empty list), the maximum height is 0.

Example:

Input: 4
       4 3 2 1
Output: 10

You need to read the input from standard input (stdin) and output the result to standard output (stdout). Ensure your solution handles edge cases efficiently.

inputFormat

The input consists of two lines:

  • The first line contains an integer n (0 ≤ n ≤ 106), representing the number of boxes.
  • If n is greater than 0, the second line contains n space-separated integers representing the heights of the boxes.

outputFormat

Output a single integer which is the maximum possible height of the stack, i.e. the sum of the heights of all boxes.

## sample
1
5
5