#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int boys, girls;
  cin >> boys;
  vector<int> boy;
  vector<int> girl;
  map<int, int> b;
  for (int i = 1; i <= boys; i++) {
    int temp;
    cin >> temp;
    boy.push_back(temp);
    b[temp]++;
  }
  cin >> girls;
  for (int i = 1; i <= girls; i++) {
    int temp;
    cin >> temp;
    girl.push_back(temp);
  }
  int ans = 0;
  sort(boy.begin(), boy.end());
  sort(girl.begin(), girl.end());
  for (int i = 0; i < girl.size(); i++) {
    int temp = girl[i];
    for (int j = 0; j < boy.size(); j++) {
      if (abs(boy[j] - temp) <= 1) {
        ans++;
        boy[j] = 1000;
        break;
      }
    }
  }
  cout << ans << "\n";
}
