#P1152A. Neko Finds Grapes

    ID: 2575 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>greedyimplementationmath*800

Neko Finds Grapes

No submission language available for this problem.

Description

On a random day, Neko found nn treasure chests and mm keys. The ii-th chest has an integer aia_i written on it and the jj-th key has an integer bjb_j on it. Neko knows those chests contain the powerful mysterious green Grapes, thus Neko wants to open as many treasure chests as possible.

The jj-th key can be used to unlock the ii-th chest if and only if the sum of the key number and the chest number is an odd number. Formally, ai+bj1(mod2)a_i + b_j \equiv 1 \pmod{2}. One key can be used to open at most one chest, and one chest can be opened at most once.

Find the maximum number of chests Neko can open.

The first line contains integers nn and mm (1n,m1051 \leq n, m \leq 10^5) — the number of chests and the number of keys.

The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai1091 \leq a_i \leq 10^9) — the numbers written on the treasure chests.

The third line contains mm integers b1,b2,,bmb_1, b_2, \ldots, b_m (1bi1091 \leq b_i \leq 10^9) — the numbers written on the keys.

Print the maximum number of chests you can open.

Input

The first line contains integers nn and mm (1n,m1051 \leq n, m \leq 10^5) — the number of chests and the number of keys.

The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai1091 \leq a_i \leq 10^9) — the numbers written on the treasure chests.

The third line contains mm integers b1,b2,,bmb_1, b_2, \ldots, b_m (1bi1091 \leq b_i \leq 10^9) — the numbers written on the keys.

Output

Print the maximum number of chests you can open.

Samples

Sample Input 1

5 4
9 14 6 2 11
8 4 7 20

Sample Output 1

3

Sample Input 2

5 1
2 4 6 8 10
5

Sample Output 2

1

Sample Input 3

1 4
10
20 30 40 50

Sample Output 3

0

Note

In the first example, one possible way to unlock 33 chests is as follows:

  • Use first key to unlock the fifth chest,
  • Use third key to unlock the second chest,
  • Use fourth key to unlock the first chest.

In the second example, you can use the only key to unlock any single chest (note that one key can't be used twice).

In the third example, no key can unlock the given chest.