### ** Stonks**

## Problem Statement

Takahashi and Aoki have recently started trading stonks to make some money.

For the next N days, Aoki will buy some stonks in the morning. On the *i*^{th} morning, he will buy *A*_{i} stonks.

Takahashi has written a script to predict the trends of the stonk market. Thus, he knows that on the *i*^{th} day, he can sell a stonk for *B*_{i} yen. He can only sell stonks which were purchased on or before that day.

Takahashi wants to know the maximum amount of money they can make selling stonks (ignore the money Aoki spends buying stonks). Code a program to help him!

## Input

The first line of input contains a single integer *N*.

The next line of input contains *N* integers, representing the array *A*.

The last line of input contains *N* integers, representing the array *B*.

## Output

The first and only line of output should contain a single integer, denoting the maximum amount of money made selling stonks.

## Limits

For all subtasks, 1 ≤ *N*, *A*_{i}, *B*_{i} ≤ 1000000.

Subtask 1 (20%): *N* ≤ 1000

Subtask 2 (15%): *A*_{i} = 1

Subtask 3 (65%): There are no more constraints.

## Sample Input

7
2 8 3 2 8 4 5
9 8 7 5 4 4 8

## Sample Output

258

## Explanation

Takahashi can sell 2 stonks on day 1, 5 stonks on day 2 and 25 stonks on day 7 for 258 yen total. This is optimal.