#K41642. Tallest Tower

    ID: 26911 Type: Default 1000ms 256MiB

Tallest Tower

Tallest Tower

You are given a collection of colored blocks. There are n different colors, and for each color i you are provided with ai blocks. Your task is to build the tallest tower possible using all the available blocks.

The height of the tower is computed as:

$\displaystyle \text{height} = \sum_{i=1}^{n} a_i$

Note: You must use every block provided.

inputFormat

The input is given in two lines:

  • The first line contains an integer n ($1 \le n \le 10^5$), representing the number of different colors.
  • The second line contains n space-separated integers a1, a2, \ldots, an ($1 \le a_i \le 10^6$), where each integer denotes the number of blocks available for that color.

outputFormat

Output a single integer representing the height of the tallest tower, which is the sum of all ai values.

## sample
3
5 2 3
10