#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, ans = 0;
  cin >> n;
  long long boy[n];
  for (long long i = 0; i < n; i++) cin >> boy[i];
  cin >> m;
  long long girl[m];
  for (long long i = 0; i < m; i++) cin >> girl[i];
  sort(boy, boy + n);
  sort(girl, girl + m);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (abs(boy[i] - girl[j]) <= 1) {
        ans++;
        girl[j] = 200;
        break;
      }
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
