4 1
3 5 7 8
2
 5 1
2 2 2 3 3
3
 4 1
1 1 2 2
2
 10 10
522312461 931001459 598654597 488228616 544064902 21923894 329635457 980089248 988262691 654502493
967529230 543358150 835120075 128123793 809901567 613170206 152157661 479980560 859252956 318029856
 27 9
72 105 100 105 110 103 32 109 101 115 115 97 103 101 115 32 105 110 32 116 101 115 116 99 97 115 101
83 110 101 97 107 32 49 48 48
 4 1
1 1 1 2
2
 7 4
116 111 117 114 105 115 116
112 101 116 114
 4 1
2 2 3 3
2
 7 4
2 2 1 1 1 1 1
2 2 2 1
 6 4
2 4 6 1 3 5
8 10 7 9
 4 2
3 2 1 4
2 3
 1 5
3
3 4 4 4 4
 5 1
1 2 3 4 5
1
 3 10
107 117 110
71 114 101 101 110 71 114 97 112 101
 1 10
1
1 2 3 4 5 6 7 8 9 10
 2 4
1 2
1 1 2 2
 5 2
1 2 2 2 2
1 1

1
 1
 1
 10
 9
 1
 4
 1
 4
 4
 2
 1
 1
 3
 1
 2
 2

'''
A. Neko Finds Grapes
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
On a random day, Neko found n treasure chests and m keys. The i-th chest has an integer ai written on it and the j-th key has an integer bj on it. Neko knows those chests contain the powerful mysterious green Grapes, thus Neko wants to open as many treasure chests as possible.

The j-th key can be used to unlock the i-th chest if and only if the sum of the key number and the chest number is an odd number. Formally, ai+bj≡1(mod2). 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.

Input
The first line contains integers n and m (1≤n,m≤105) — the number of chests and the number of keys.

The second line contains n integers a1,a2,…,an (1≤ai≤109) — the numbers written on the treasure chests.

The third line contains m integers b1,b2,…,bm (1≤bi≤109) — the numbers written on the keys.

Output
Print the maximum number of chests you can open.

Examples
inputCopy
5 4
9 14 6 2 11
8 4 7 20
outputCopy
3
inputCopy
5 1
2 4 6 8 10
5
outputCopy
1
inputCopy
1 4
10
20 30 40 50
outputCopy
0
Note
In the first example, one possible way to unlock 3 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.
'''


n, m = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

a1 = len(list(filter(lambda x: x%2!=0, a)))
b1 = len(list(filter(lambda x: x%2!=0, b)))

print(a1+b1)
