#include <bits/stdc++.h>
using namespace std;
int coun[2][2];
int main() {
  int m, n, a;
  scanf("%d %d", &m, &n);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a);
    coun[0][a & 1]++;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    coun[1][a & 1]++;
  }
  printf("%d", min(coun[0][1], coun[1][0]) + min(coun[0][0], coun[1][1]));
}
