Gabriel is playing 2048. In this game, squares appear with a number on it. All the numbers are positive powers of 2. You can combine two of the same power to get one power greater. For example, if you combine two ~32~s you get a ~64~ square. Gabriel has ~N~ squares and wants to know the biggest square he can obtain from combining.
A single integer, ~N~ ~(1 \le N \le 1000)~, the number of squares.
The second line contains ~N~ integers, ~x_i~, the number on the squares. ~x_i = 2^p, p \in [1, 20]~
A single integer, the biggest square can Gabriel can theoretically create.
Sample Input 1
3 2 4 2
Sample Output 1
Explanation for Sample Output 1
Gabriel can combine the two ~2~s to make a ~4~ and then he can combine the two ~4~s he has to make an ~8~.
Sample Input 2
5 2 2 8 16 32
Sample Output 2
Explanation for Sample Output 2
Although Gabriel can combine the two ~2~s, he cannot make any more moves. The biggest square he has is ~32~.