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

n,m=input().split()
n=int(n)
m=int(m)
chests=list(map(int,input().split()))
keys=list(map(int,input().split()))
minEven=0
minOdd=0
countOdd=0
countEven=0
for i in chests:
    if i % 2 == 0:
        countEven+=1
    else:
        countOdd+=1
minEven=countEven
minOdd=countOdd
countOdd=0
countEven=0
for i in keys:
    if i % 2 == 0:
        countEven+=1
    else:
        countOdd+=1
if countEven<minOdd:
    minOdd=countEven
if countOdd<minEven:
    minEven=countOdd
print(minOdd+minEven)