Two Towers

No attempts yetTime limit1sMemory limit128 MB

Problem

Little Bajtek received a set of blocks from his grandfather. Each block has a certain height. Bajtek stacks the blocks one on top of another to form a tower. Using all of his blocks, he built two towers.

Now he wonders what is the minimum number of blocks he has to remove so that both towers have the same height. Blocks may be removed only from the top of each tower, and no new blocks may be added. In particular, it is allowed to remove all of the blocks from a tower. If every block is removed from both towers, both heights become 0 and are therefore equal.

Input

The first line contains two integers nn, mm (1n,m1061 \le n, m \le 10^6), the number of blocks in the first and the second tower respectively.

The second line contains nn integers a1,a2,,ana_1, a_2, \dots, a_n (1ai1091 \le a_i \le 10^9), where aia_i is the height of the ii-th block of the first tower counting from the bottom; a1a_1 is the bottom block and ana_n is the top block.

The third line contains mm integers b1,b2,,bmb_1, b_2, \dots, b_m (1bi1091 \le b_i \le 10^9), where bib_i is the height of the ii-th block of the second tower counting from the bottom; b1b_1 is the bottom block and bmb_m is the top block.

Output

Print a single integer: the minimum number of blocks that must be removed so that both towers have the same height.

Hint