#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int a, b, c, boy[105] = {}, girl[105] = {}, s = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> c;
    boy[c]++;
  }
  cin >> b;
  for (int i = 0; i < b; i++) {
    cin >> c;
    girl[c]++;
  }
  for (int i = 1; i <= 100; i++) {
    if (boy[i] != 0 && girl[i - 1] != 0) {
      c = min(boy[i], girl[i - 1]);
      s += c;
      boy[i] -= c;
      girl[i - 1] -= c;
    }
    if (boy[i] != 0 && girl[i] != 0) {
      c = min(boy[i], girl[i]);
      s += c;
      boy[i] -= c;
      girl[i] -= c;
    }
    if (boy[i] != 0 && girl[i + 1] != 0) {
      c = min(boy[i], girl[i + 1]);
      s += c;
      boy[i] -= c;
      girl[i + 1] -= c;
    }
  }
  cout << s;
  return 0;
}
