#include <bits/stdc++.h>
using namespace std;
int n, m;
int b[107], g[107];
void solve() {
  cin >> n;
  for (int i = 1; i <= (n); ++i) cin >> b[i];
  cin >> m;
  for (int i = 1; i <= (m); ++i) cin >> g[i];
  sort(b + 1, b + n + 1);
  sort(g + 1, g + m + 1);
  int sum = 0;
  for (int i = 1; i <= (n); ++i) {
    for (int j = 1; j <= (m); ++j) {
      if (abs(b[i] - g[j]) < 2) {
        g[j] = 1000000007;
        ++sum;
        break;
      }
    }
  }
  cout << sum;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
