#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int arr[100001];
  int brr[100001];
  int ae = 0;
  int ao = 0;
  int be = 0;
  int bo = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] & 1) {
      ao += 1;
    } else {
      ae += 1;
    }
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &brr[i]);
    if (brr[i] & 1) {
      bo += 1;
    } else {
      be += 1;
    }
  }
  int ans = 0;
  ans = min(ao, be) + min(bo, ae);
  printf("%d", ans);
}
