I want to honey, and more...
Misha, like his cartoon friend of Winnie the Pooh, was very fond of honey. So he waited impatiently for the moment when the apiary could be tackled his collection. However, there are several problems, primarily due to the fact that the bees themselves is not very fond of this day, when the bear was collecting honey ...
To bee able to continue to bring honey and suffered as little as possible, so that he himself was bitten by the same bees smaller (ie, the bear has not been twice on one and the apiary site, where the beehives from which honey is withdrawn ), Misha during collection always began gathering honey in the upper left corner of his apiaries and continue to move only right and down until it reaches the bottom right hive, and then moved back to the beginning, but moved to an apiary only the left and up.
Help Misha find a route on which he will gather the largest number of his favorite treats.
Input
The input data contain several test cases. Each test case begins with the line, which indicates the number of hives in the apiary N (1 < N ≤ 600). Subsequent N lines each test set the weight in kilograms of honey, which bear may be taken from a given point situated in the apiary hive. It is known that bees in each hive could not collect more than 100 kilograms of honey.
Output
For each test case the optimal output in terms of Misha's crop of honey.