#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 5;
int n, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  int odd = 0, even = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    if (num % 2)
      odd++;
    else
      even++;
  }
  for (int i = 0; i < k; i++) {
    int num;
    cin >> num;
    if (num % 2 && even) {
      ans++;
      even--;
    }
    if (num % 2 == 0 && odd) {
      ans++;
      odd--;
    }
  }
  cout << ans << endl;
  return 0;
}
