#include <bits/stdc++.h>
using namespace std;
int a;
int c1[2], c2[2];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    c1[a & 1]++;
  }
  for (int i = 1; i <= m; ++i) {
    cin >> a;
    c2[a & 1]++;
  }
  int ans = min(c1[0], c2[1]) + min(c1[1], c2[0]);
  cout << ans;
}
