#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b, c, d;
long long ans;
signed main() {
  long long n, m, x;
  cin >> n >> m;
  for (long long i = 0; i < n; ++i) {
    cin >> x;
    if (x % 2 == 0)
      a.push_back(x);
    else
      b.push_back(x);
  }
  for (long long i = 0; i < m; ++i) {
    cin >> x;
    if (x % 2 == 0)
      c.push_back(x);
    else
      d.push_back(x);
  }
  cout << min((long long)(a).size(), (long long)(d).size()) +
              min((long long)(b).size(), (long long)(c).size());
}
