Skyscraper
Vus the Cossack lives in a skyscraper.
Since he started working as a builder, customers gave him the task to build skyscrapers. One of them should be at a distance of one kilometer from the skyscraper of Vus the Cossack, the other should be at a distance of two kilometers, the other should be at a distance of three kilometers and so on. All skyscrapers (including Cossack) must be on the same line, with his skyscraper being the leftmost.
The -th customer wants his skyscraper to be high. However, customers do not care how far their skyscrapers will be from the Vus' skyscraper. Therefore, the Cossack can decide for himself in what order to build other skyscrapers from his skyscraper.
Vus the Cossack wants to make the view from his skyscraper as beautiful as possible. We will assume that the -th floor of a certain skyscraper is visible from the Mustache skyscraper only if there is no other skyscraper between them that will have the -th floor. Vus the Cossack believes that every floor of the -th skyscraper has the beauty of . Therefore, he wants the total beauty of all the floors he will see from his skyscraper to be as great as possible.
An example for = 4.
The figure shows an example for . At a distance of one kilometer built a two-story skyscraper with the beauty of . Then one-story with the beauty of . Then a three-story with the beauty of . Finally, the latter built a -story skyscraper with a beauty. From the Vus' skyscraper you can see only both floors of the first skyscraper, the third floor of the third and the fourth floor of the fourth skyscraper. Accordingly, we consider the total beauty of these floors: . Note that this may not be the optimal order of construction.
Help him find the maximum possible beauty.
Input
The first line contains one integer () — the number of skyscrapers that need to be built.
The second line contains integers () — the height of skyscrapers.
The third line contains integers () — the beauty of the floors in the skyscrapers.
Output
Print one integer — the maximum possible total beauty.
Examples
Scoring
( points) ;
( points) ;
( points) ;
( points) without additional restrictions.