#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  deque<long long int> b, g;
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    long long int temp;
    cin >> temp;
    b.push_back(temp);
  }
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    long long int temp;
    cin >> temp;
    g.push_back(temp);
  }
  sort(b.begin(), b.end());
  sort(g.begin(), g.end());
  long long int ans = 0;
  while (b.size() && g.size()) {
    if (abs(b.front() - g.front()) <= 1) {
      ans++;
      b.pop_front();
      g.pop_front();
    } else {
      if (b.front() < g.front())
        b.pop_front();
      else
        g.pop_front();
    }
  }
  cout << ans;
  return 0;
}
