Stepan - businessman#7240

Stepan - businessman

0.3 seconds
256 megabytes
Easy

Uzhlandia is renowned for its thriving trade relations.

Stepan has decided to venture into trading computer equipment to earn some money for his vacation. To do this, he plans to purchase equipment from other sellers. Before proceeding, he wants to analyze the market in Uzhlandia to determine how to maximize his profit.

Stepan discovered that each seller offers one computer, and each buyer is interested in purchasing exactly one computer. There are sellers in the market, with the -th seller offering a computer for A_i Uzhlandian coins. The prices may differ among sellers. Additionally, there are potential buyers, each willing to pay B_i coins for a computer. Stepan can buy and sell any number of computers.

Stepan's goal is to achieve the highest possible profit by buying low and selling high. That is why he turned to you, the best programmer in Uzhlandia, for help.

Input

The first line contains two integers (1 \leq N, M \leq 10^5) — the number of sellers and the number of potential buyers, respectively.

The second line contains integers A_i (0 \leq A_i \leq 10^9) — the prices at which the sellers are willing to sell computers.

The third line contains integers B_i (0 \leq B_i \leq 10^9) — the amounts the potential buyers are willing to pay for a computer.

Output

Print a single integer — the maximum possible profit in coins that Stepan can achieve.

Examples

Example 1

Loading
Loading

Note

In the first example, Stepan buys computers from the 1st and 2nd sellers and sells them to any two buyers.

In the second example, it is most profitable for Stepan to buy computers from the 1st, 4th, and 6th sellers and sell them to the 3rd, 4th, and 5th buyers.