#include <bits/stdc++.h>
using namespace std;
struct edge {
  int a, b, nt;
} e[100010];
int p[100010], cnt;
int n, m;
int a[110], b[110];
void aedge(int x, int y) {
  cnt++;
  e[cnt].b = y;
  e[cnt].a = x;
  e[cnt].nt = p[x];
  p[x] = cnt;
}
void anode(int x, int y) {
  aedge(x, y);
  aedge(y, x);
}
int match[2000], flag[22000];
bool mat(int x) {
  for (int i = p[x]; i; i = e[i].nt) {
    int t = e[i].b;
    if (!flag[t]) {
      flag[t] = 1;
      if (match[t] == -1 || mat(match[t])) {
        match[t] = x;
        return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (abs(b[i] - a[j]) <= 1) {
        anode(i + n, j);
      }
    }
  }
  int ans = 0;
  memset(match, -1, sizeof(match));
  for (int i = 1; i <= n; i++) {
    memset(flag, 0, sizeof(flag));
    if (mat(i)) ans++;
  }
  printf("%d\n", ans);
}
