Minimum Sum#6198

Minimum Sum

1 second
128 megabytes
Easy

There are two arrays of positive integers and . Find a permutation i_1, i_2, ..., i_n of numbers 1, 2, ..., n, for which the sum

a_1 \cdot b_{i_1} + ... + a_n \cdot b_{i_n}

is minimal. Each number should appear only once in the permutation.

Input

The first line contains the number of elements n~(n \le 100) in the arrays. The second line contains the elements of the first array, and the third line contains the elements of the second array. The array elements do not exceed 10^6.

Output

Print the minimal value of required sum.

Examples

Example 1

Loading
Loading