#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long oc = 0, ok = 0, ec = 0, ek = 0;
  for (long long i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    if (temp % 2 == 0) {
      ec++;
    } else
      oc++;
  }
  for (int i = 0; i < m; i++) {
    long long temp;
    cin >> temp;
    if (temp % 2 == 0) {
      ek++;
    } else
      ok++;
  }
  cout << min(ec, ok) + min(oc, ek) << endl;
}
