#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, odd = 0, even = 0, odd2 = 0, even2 = 0;
  cin >> n >> m;
  int arra[n + 1];
  int arra2[m + 1];
  for (int i = 0; i < n; i++) {
    cin >> arra[i];
    if (arra[i] % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  for (int i = 0; i < m; i++) {
    cin >> arra2[i];
    if (arra2[i] % 2 == 0) {
      even2++;
    } else {
      odd2++;
    }
  }
  int opp = min(even, odd2);
  int opp2 = min(even2, odd);
  cout << opp + opp2 << endl;
  return 0;
}
