#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int INF = 1e9 + 7;
int md[N];
int n, m, ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    md[a % 2]++;
  }
  for (int i = 1; i <= m; i++) {
    int a;
    cin >> a;
    if (md[(a % 2 + 1) % 2] != 0) {
      md[(a % 2 + 1) % 2]--;
      ans++;
    }
  }
  cout << ans;
}
