Start: Jun, 22, 2019 13:00:00
阿力的最后一场难题
End: Jun, 22, 2019 16:00:00
Contest has ended!
Time elapsed: 03:00:00
Time remaining: 00:00:00

阿力的序列 1090

Time Limit:  1 Sec    Memory Limit:   256 MB
Submission:32     AC:8     Score:0


Description

Ali recently started picking up passengers. Since he was very short of money, he took all the orders that he could pick up at once. He accepted a total of n orders, each with a remaining completion time and commission.
For the sake of convenience, Ali assumes that the current time is 0. He knows the remaining completion time and commission for each order. The time for completing each order is 1. How can he do more to get more commission.

Input

The first line contains an integer n, which means that there are a total of n lists.
The second line contains n integers ai, indicating the remaining completion time of the i-th order
The third line contains n integers bi, indicating the commission of the i-th item.

Output

The output contains an integer representing the maximum commission that Ali can get.

Samples

input:
3 1 3 1 6 2 3
output:
8

Hint

1<=ai,bi,n<=1000