#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210;
const int MAXM = 2e5 + 10;
const long long MOD = 1e9 + 7;
const long long INF = 0x3f3f3f3f;
char rubbish[110];
long long read() {
  long long x = 0, f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - 48;
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return x * f;
}
struct edge {
  int to, nxt, cap;
} es[MAXM << 3];
int N, M, K;
int a[MAXN];
int b[MAXN];
int head[MAXN];
int tot;
queue<int> q;
int dep[MAXN];
void init() {
  for (int i = N + M + 2; i >= 0; i--) {
    head[i] = -1;
  }
  tot = 0;
}
void addedge(int u, int v, int cap) {
  es[tot] = edge{v, head[u], cap};
  head[u] = tot++;
}
void add(int u, int v, int cap) {
  addedge(u, v, cap);
  addedge(v, u, 0);
}
int bfs(int s, int e) {
  int u, v;
  while (!q.empty()) {
    q.pop();
  }
  for (int i = s; i <= e; i++) {
    dep[i] = 0;
  }
  q.push(s);
  dep[s] = 1;
  while (!q.empty()) {
    u = q.front();
    q.pop();
    for (int i = head[u]; ~i; i = es[i].nxt) {
      v = es[i].to;
      if (es[i].cap && !dep[v]) {
        dep[v] = dep[u] + 1;
        if (v == e) {
          return 1;
        }
        q.push(v);
      }
    }
  }
  return 0;
}
int dfs(int u, int e, int flow) {
  if (u == e) {
    return flow;
  }
  int rflow;
  int used = 0;
  int v;
  for (int i = head[u]; ~i; i = es[i].nxt) {
    v = es[i].to;
    if (dep[v] == dep[u] + 1 && es[i].cap) {
      if (rflow = dfs(v, e, min(es[i].cap, flow - used))) {
        used += rflow;
        es[i].cap -= rflow;
        es[i ^ 1].cap += rflow;
        if (used == flow) {
          break;
        }
      } else {
        dep[v] = 0;
      }
    }
  }
  return used;
}
int dinic(int s, int e) {
  int flow = 0;
  while (bfs(s, e)) {
    flow += dfs(s, e, INF);
  }
  return flow;
}
void solve() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    a[i] = read();
  }
  scanf("%d", &M);
  for (int i = 1; i <= M; i++) {
    b[i] = read();
  }
  init();
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (abs(a[i] - b[j]) <= 1) {
        add(i, N + j, 1);
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    add(0, i, 1);
  }
  for (int i = 1; i <= M; i++) {
    add(N + i, N + M + 1, 1);
  }
  printf("%d\n", dinic(0, N + M + 1));
}
int main() {
  int T;
  T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
