#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
int a[MAX_N], b[MAX_N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  int x[2] = {0, 0};
  for (int i = 0; i < n; i++) {
    x[a[i] % 2]++;
  }
  int y[2] = {0, 0};
  for (int i = 0; i < m; i++) {
    y[b[i] % 2]++;
  }
  int ans = min(x[0], y[1]) + min(x[1], y[0]);
  cout << ans;
}
