#include <bits/stdc++.h>
using namespace std;
int n, m, a[101], b[101];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n, greater<int>());
  sort(b, b + m, greater<int>());
  int ai = 0, bi = 0, cnt = 0, dif;
  while (ai < n && bi < m) {
    dif = abs(a[ai] - b[bi]);
    if (dif == 0 || dif == 1) {
      ++cnt;
      bi++, ai++;
      continue;
    } else if (a[ai] > b[bi])
      ai++;
    else
      bi++;
  }
  cout << cnt << endl;
}
