#include <bits/stdc++.h>
using namespace std;
int b[101], g[101];
int main() {
  int n, m, res = 0, k = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> b[i];
  cin >> m;
  for (int i = 1; i <= m; i++) cin >> g[i];
  sort(b + 1, b + n + 1);
  sort(g + 1, g + m + 1);
  if (b[1] <= g[1]) {
    for (int i = 1; i <= n; i++) {
      for (int j = k; j <= m; j++) {
        if (g[j] != 0 && fabs(b[i] - g[j]) <= 1) {
          res++;
          k = j + 1;
          break;
        }
      }
    }
  } else
    for (int i = 1; i <= m; i++) {
      for (int j = k; j <= n; j++) {
        if (b[j] != 0 && fabs(g[i] - b[j]) <= 1) {
          res++;
          k = j + 1;
          break;
        }
      }
    }
  cout << res;
  return 0;
}
