#include <bits/stdc++.h>
using namespace std;
inline bool isLow(char ch) {
  if (ch >= 'a' && ch <= 'z') return true;
  return false;
}
inline bool isUpp(char ch) {
  if (ch >= 'A' && ch <= 'Z') return true;
  return false;
}
inline bool isDig(char ch) {
  if (ch >= '0' && ch <= '9') return true;
  return false;
}
inline bool are_equal(double a, double b) {
  return fabs(a - b) < numeric_limits<double>::epsilon();
}
inline bool greater_than(double a, double b) {
  return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) *
                    numeric_limits<double>::epsilon());
}
inline bool less_than(double a, double b) {
  return (b - a) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) *
                    numeric_limits<double>::epsilon());
}
template <typename T>
string toString(T x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
template <typename T>
T SOD(T n) {
  __typeof(n) sum = 0, i = 1;
  for (; i * i <= n; i++)
    sum += (n % i) ? 0 : ((((i) * (i)) == n) ? i : i + n / i);
  return sum;
}
template <typename T>
T stringToT(string s, T a) {
  T p;
  istringstream ss(s);
  ss >> p;
  return p;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < v.size(); i++) {
    os << v[i];
    if (i != (int)v.size() - 1) os << ", ";
  }
  os << "]";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << "[";
  for (auto it : v) {
    os << it;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "]";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  for (auto it : v) os << it.first << " : " << it.second << '\n';
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(" << v.first << ", " << v.second << ")";
  return os;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a;
    a = ((a) * (a));
    b >>= 1;
  }
  return res;
}
long long bigmod(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = ((res % m) * (a % m)) % m;
    }
    a = ((a % m) * (a % m)) % m;
    b >>= 1;
  }
  return res;
}
long long modInverse(long long a, long long m) { return bigmod(a, m - 2, m); }
const int mod = 1e9 + 7;
const int mx = 2 * 100001;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a = 0, b = 0, c = 0, d = 0, x;
  for (__typeof(n - 1) i = (0); i <= (n - 1); i++) {
    scanf("%d", &x);
    if (x & 1)
      a++;
    else
      b++;
  }
  for (__typeof(m - 1) i = (0); i <= (m - 1); i++) {
    scanf("%d", &x);
    if (x & 1)
      c++;
    else
      d++;
  }
  printf("%d\n", (min(a, d) + min(b, c)));
  return 0;
}
