#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[105], b[105];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  sort(a, a + n);
  sort(b, b + m);
  int ia = 0, ib = 0, ans = 0;
  while (ia < n && ib < m) {
    if (abs(a[ia] - b[ib]) <= 1) {
      ia++;
      ib++;
      ans++;
    } else {
      if (a[ia] > b[ib])
        ib++;
      else
        ia++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
