The first line of input contains N, and the next N lines give the sequence of N numbers at the start
of the game.
Please output the largest integer Bessie can generate.
4
1
1
1
2
3
//In this example shown here, Bessie first merges the second and third 1s to obtain the sequence 1 2 2
, and then she merges the 2s into a 3. Note that it is not optimal to join the first two 1s.