Problem D: 捕鱼旺季

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:16 Solved:10

Description

又是捕鱼的旺季,码头上摆了 n 筐的捕捞的鲜鱼,阳光渔业公司的老板找到了大老李,要他每次担起两筐鱼合并成一堆,然后用货车运走。合并的劳务费就等于这两筐鱼的斤数。

若将这 n 筐鱼都合并完成,大老李最多能获得多少劳务费?

Input

第一行为 n, 第二行为 n 个整数。

Output

输出一个数, 为最多的劳务费。

Sample Input Copy

4
36 28 42 32

Sample Output Copy

326