#include <bits/stdc++.h>
using namespace std;
queue<int> q;
int boy_num, girl_num, boys[100], girls[100], graph[202][202];
int findpath() {
  int vis[202], parent[202];
  for (int i = 0; i < 202; i++) {
    vis[i] = 0;
    parent[i] = -1;
  }
  while (!q.empty()) q.pop();
  vis[0] = 1;
  q.push(0);
  int flag = 0;
  while (!q.empty()) {
    int s = q.front();
    q.pop();
    for (int i = 1; i <= boy_num + girl_num + 1; i++) {
      if (graph[s][i] && !vis[i]) {
        vis[i] = 1;
        parent[i] = s;
        q.push(i);
        if (i == boy_num + girl_num + 1) flag = 1;
      }
    }
    if (flag) break;
  }
  int dest = boy_num + girl_num + 1;
  int cap = 0;
  int p = parent[dest];
  int child = dest;
  while (p != -1) {
    if (graph[p][child] == 1) cap = 1;
    child = p;
    p = parent[child];
  }
  p = parent[dest];
  child = dest;
  while (p != -1) {
    graph[p][child]--;
    graph[child][p]++;
    child = p;
    p = parent[child];
  }
  return cap;
}
int count() {
  int ans = 0, d;
  do {
    d = findpath();
    ans += d;
  } while (d);
  return ans;
}
int main() {
  scanf("%d", &boy_num);
  for (int i = 0; i < boy_num; i++) scanf("%d", &boys[i]);
  scanf("%d", &girl_num);
  for (int i = 0; i < girl_num; i++) scanf("%d", &girls[i]);
  for (int i = 0; i <= 201; i++)
    for (int j = 0; j <= 201; j++) graph[i][j] = 0;
  int num_boys = boy_num;
  int num_girls = girl_num;
  for (int i = 1; i <= num_boys; i++) graph[0][i] = 1;
  for (int i = num_boys + 1; i <= num_boys + num_girls; i++)
    graph[i][num_girls + num_boys + 1] = 1;
  for (int i = 0; i < num_boys; i++) {
    for (int j = 0; j < num_girls; j++) {
      if (fabs(boys[i] - girls[j]) <= 1) graph[i + 1][num_boys + j + 1] = 1;
    }
  }
  int ans = count();
  printf("%d\n", ans);
}
