#K83147. Taco Parade

    ID: 36133 Type: Default 1000ms 256MiB

Taco Parade

Taco Parade

You are given n checkpoints, each with an excitement level. During the parade, you must skip exactly one checkpoint. Your task is to calculate the maximum possible total excitement by summing up the excitement levels of the visited checkpoints, which is the total sum of all given excitement levels minus the smallest excitement level.

Formally, if the excitement levels are given by \(e_1, e_2, \dots, e_n\), then the answer is:

\(\sum_{i=1}^{n} e_i - \min(e_1, e_2, \dots, e_n)\)

You need to implement a solution that reads input from stdin and writes the answer to stdout.

inputFormat

The first line of input contains an integer n indicating the number of checkpoints.

The second line contains n space-separated integers where each integer represents the excitement level at a checkpoint.

outputFormat

Output a single integer, the maximum total excitement obtainable after skipping exactly one checkpoint.

## sample
5
3 2 5 7 4
19

</p>