#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100 + 20;
long long girl[maxn];
long long boy[maxn];
bool mark_g[maxn];
bool mark_b[maxn];
long long ans;
int32_t main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> girl[i];
  long long m;
  cin >> m;
  for (long long i = 0; i < m; i++) cin >> boy[i];
  for (long long i = 0; i < max(n, m) + 1; i++) {
    mark_b[i] = false;
    mark_g[i] = false;
  }
  sort(girl, girl + n);
  sort(boy, boy + m);
  for (long long i = 0; i < m; i++) {
    if (mark_b[i] != true)
      for (long long j = 0; j < n; j++) {
        if (mark_g[j] != true)
          if (abs(boy[i] - girl[j]) <= 1) {
            mark_b[i] = true;
            mark_g[j] = true;
            ans++;
            break;
          }
      }
  }
  cout << ans << endl;
  return 0;
}
