#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, arr[100001], arr1[100001], odd1 = 0, odd2 = 0, even1 = 0,
                                                 even2 = 0;
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 0)
      even1++;
    else
      odd1++;
  }
  for (long long int i = 0; i < m; i++) {
    cin >> arr1[i];
    if (arr1[i] % 2 == 0)
      even2++;
    else
      odd2++;
  }
  cout << min(odd1, even2) + min(odd2, even1);
  return 0;
}
