#include <bits/stdc++.h>
using namespace std;
long long modulo = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a;
  int arr1[a];
  for (int i = 0; i < a; ++i) {
    cin >> arr1[i];
  }
  cin >> b;
  int arr2[b];
  for (int i = 0; i < b; ++i) {
    cin >> arr2[i];
  }
  sort(arr2, arr2 + b);
  sort(arr1, arr1 + a);
  int ans = 0;
  for (int i = 0; i < b; ++i) {
    for (int j = 0; j < a; ++j) {
      if (abs(arr2[i] - arr1[j]) <= 1) {
        ++ans;
        arr1[j] = 1002;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
