#include <bits/stdc++.h>
using namespace std;
bool visited[100];
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int m;
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  int c = 0;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < b.size(); j++) {
      if (visited[j] != true) {
        if (abs(a[i] - b[j]) <= 1) {
          visited[j] = true;
          c++;
          break;
        }
      }
    }
  }
  cout << c << endl;
}
