#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int od, ev;
int n, m, a[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    int b;
    cin >> b;
    if (b % 2 == 1)
      od++;
    else
      ev++;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0 && od > 0) {
      od--;
      ans++;
    }
    if (a[i] % 2 == 1 && ev > 0) {
      ev--;
      ans++;
    }
  }
  cout << ans;
}
