#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int cnt[2][1002];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    cnt[0][a]++;
  }
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    cnt[1][a]++;
  }
  int ans = 0;
  for (int i = 1; i <= 100; i++) {
    int temp = min(cnt[0][i], cnt[1][i]);
    ans += temp;
    cnt[0][i] -= temp;
    cnt[1][i] -= temp;
    temp = min(cnt[0][i], cnt[1][i + 1]);
    ans += temp;
    cnt[0][i] -= temp;
    cnt[1][i + 1] -= temp;
    temp = min(cnt[1][i], cnt[0][i + 1]);
    ans += temp;
    cnt[1][i] -= temp;
    cnt[0][i + 1] -= temp;
  }
  cout << ans;
  return 0;
}
