#include <bits/stdc++.h>
using namespace std;
const int MaxV = 100 + 1;
int n, m, sb[MaxV], sg[MaxV], fa[MaxV], ans;
bool vis[MaxV];
bool find(int x) {
  vis[x] = 1;
  for (int i = 1; i <= m; i++)
    if (abs(sb[x] - sg[i]) <= 1 && (!fa[i] || (!vis[fa[i]] && find(fa[i])))) {
      fa[i] = x;
      return true;
    }
  return false;
}
void solve() {
  for (int i = 1; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    if (find(i)) ans++;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &sb[i]);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", &sg[i]);
  solve();
  printf("%d", ans);
  return 0;
}
