Keenan got
In order for three sticks with lengths
Keenan wants to maximize the sum of the perimeters of the two triangles he makes. Help him compute this! Note that a stick cannot be used in both triangles.
Constraints
Input Specification
The first line contains one integer,
Each of the next
Output Specification
Output the maximum possible sum of the perimeters of the two triangles Keenan makes. If Keenan cannot make two triangles, output 0
.
Sample Input
Copy
6
1
1
1
1
1
1
Sample Output
Copy
6
Comments