Candy Lottery
At the start of the First Open Cup of Oleksandriia, the organizers decided to host a lottery! The key component of this lottery is N barrels, each marked with a unique integer A[i], placed inside a bag. The numbers on these barrels are all distinct.
There are N -1 participants in the Cup. Each participant, in turn, approaches the organizers and draws two barrels from the bag. From these two barrels, the participant keeps the one with the larger number, while the other is returned to the bag. Naturally, after all participants have made their selections, exactly one barrel will remain in the bag.
At the conclusion of the event, there will be a celebratory candy distribution. Each participant receives candies equivalent to the number on the barrel they retained.
The organizers are tasked with determining the maximum number of candies that might be required for the lottery. Your job is to assist them in calculating the maximum possible number of candies that all participants can collectively receive.
Input
The first line contains a single integer N – the number of barrels (2 ≤ N ≤ 100). The second line lists N distinct integers A[i], (1 ≤ A[i] ≤ 32767), separated by spaces.
Output
Output a single integer – the maximum possible number of candies that all participants can receive.