URI Online Judge | 1802 | [P1]
# Books Catalog

**Timelimit: 2**

By Thalyson Nepomuceno, Universidade Estadual do Ceará Brazil

Bino is preparing a book catalog. He is organizing a catalog with **K** different sets of books to sell in your online store. Each set of books consists of five books, one for each subject (portuguese, mathematics, physics, chemistry and biology). Two sets of books are considered distinct if there is at least one book that is at one and the other is not. Bino want to expose on the site only the most expensive distinct sets, and asked for your help.

The value of each set is the sum of the values of each book that's in it. Your task is to calculate the total value of **K** more expensive distinct sets of books. In case of a draw among the most expensive sets, Bino choose any more expensive set.

The input consists of 6 lines: The first line contains an integer P (5 ≤ P ≤ 10), representing that Bino has **P** different types of portuguese books, followed by **P** integers **v _{i }**(1 ≤

Print the sum of **K** more expensive distinct sets of books.

Input Sample | Output Sample |

5 2 5 6 3 8 |
42 |

Input Sample | Output Sample |

5 2 5 6 3 8 |
397 |