Олимпиадный тренинг

Задача 38929. Snezhik Sugrobovich - 1


Задача

Темы: Цикл for
In some world, it's December 31st. N Christmas trees are growing in Father Frost's garden. Snezhik Sugrobovich decided to decorate the Christmas trees with a garland. To make the light from the garland visible as far as possible, he fixed the garland on top of the three tallest Christmas trees. Determine the total height to which Snezhik Sugrobovich will rise, hanging a garland.

Input
The first line contains the number N - the number of trees (4 < N <= 100), and then N integers - the height of each tree.

Imprint
Output the answer to the problem.

Examples
# Input Output
1 7
3
3
6
3
4
3
4
14
 
 
Запрещенные операторы:list;[;sort