#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n = 0, m = 0;
  cin >> n >> m;
  int temp;
  int a_odd = 0, a_even = 0;
  int b_odd = 0, b_even = 0;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (temp % 2 == 0) {
      a_even++;
    } else {
      a_odd++;
    }
  }
  for (int i = 0; i < m; i++) {
    cin >> temp;
    if (temp % 2 == 0) {
      b_even++;
    } else {
      b_odd++;
    }
  }
  cout << min(a_odd, b_even) + min(a_even, b_odd) << endl;
}
