#include <bits/stdc++.h>
using namespace std;
int findPartner(vector<int> b, int num, int start) {
  int j;
  j = start + 1;
  for (; j < b.size(); j++) {
    int diff = abs(num - b[j]);
    if (diff == 0 || diff == 1) break;
  }
  return j;
}
int main() {
  int n, m, j;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int s = min(n, m);
  bool flag = (s == n) ? true : false;
  vector<int> dp(s + 1, 0);
  dp[0] = 0;
  j = -1;
  for (int i = 0; i < s; i++) {
    dp[i + 1] = dp[i];
    if (flag) {
      int temp = j;
      j = findPartner(b, a[i], j);
      if (j >= b.size()) {
        j = temp;
        continue;
      }
    } else {
      int temp = j;
      j = findPartner(a, b[i], j);
      if (j >= a.size()) {
        j = temp;
        continue;
      }
    }
    dp[i + 1] += 1;
  }
  cout << dp[s] << endl;
  return 0;
}
