Woburn Challenge 2015-16 Round 1 - Junior Division

The renowned Woburn Jazz Band is putting on a concert!
Their current repertoire consists of
Since the band is so spectacular, they are always receiving requests to
fill more and more time. Unfortunately, rehearsal times are tight and
practicing any more than these
With all this information, Mr. Farrow needs to know ahead of time the length of the entire concert so that he can report it to the principal for scheduling purposes. Given the lengths of all the pieces in the Jazz Band's repertoire, please help Mr. Farrow determine the maximum amount of time (in minutes) that the concert could possibly last, including the intermission time and given that optimal choices will be made for which two songs are to be repeated.
Input Specification
Line
Output Specification
Output a single integer representing the maximum possible length of the concert in minutes.
Sample Input
4
10
10
20
25
Sample Output
120
Comments