Histogram
The histogram is a polygon formed from the sequence of rectangles, aligned on a common baseline. The rectangles are of equal width, but may have different heights. For example, the figure on the left shows the histogram, which consists of rectangles with heights of . All rectangles in this figure have a width equal to .
Usually, histograms are used to represent discrete distributions, for example, the frequency of characters in the texts. Note that the order of the rectangles is very important. Calculate the area of the largest rectangle in the histogram, which is also located on a common baseline. The figure on the right is the shaded figure is equal to the largest aligned rectangle on the image histogram.
Input
First line contains the number of rectangles of the histogram. This is followed by integers . These numbers indicate the height of the rectangle of the histogram from left to right. The width of each rectangle is equal to .
Output
Print the area of the largest rectangle in the histogram. Remember that this rectangle should be on a common baseline.