#include <bits/stdc++.h>
using namespace std;
int male[105];
int fem[105];
int main() {
  int b, g;
  cin >> b;
  int cnt = 0;
  for (int i = 0; i < b; i++) {
    cin >> male[i];
  }
  sort(male, male + b);
  cin >> g;
  for (int i = 0; i < g; i++) {
    cin >> fem[i];
  }
  sort(fem, fem + g);
  int i = 0, j = 0;
  while (i < b && j < g) {
    if (abs(male[i] - fem[j]) <= 1) {
      i++;
      j++;
      cnt++;
    } else if (male[i] > fem[j]) {
      j++;
    } else
      i++;
  }
  cout << cnt << endl;
  return 0;
}
