Given a sequence of length . Find its subsequence such that
the numbers in the subsequence are sorted in strictly ascending order.
the sum of numbers in the subsequence is the biggest
The first line contains the size of array .The second line contains integers .
Print the sum of the maximum sum subsequence.
For example, if input is , then output should be .