#include <bits/stdc++.h>
using namespace std;
vector<int> V[300];
int parent[300] = {-1};
int capacity[300][300] = {0};
void BFS(int current_number, int goal_number, bool is_visited[]) {
  queue<int> Queue;
  Queue.push(current_number);
  is_visited[current_number] = true;
  while (!Queue.empty()) {
    current_number = Queue.front();
    Queue.pop();
    if (current_number == goal_number) {
      is_visited[current_number] = true;
      return;
    }
    is_visited[current_number] = true;
    for (std::vector<int>::iterator iter = V[current_number].begin();
         iter != V[current_number].end(); iter++) {
      if (is_visited[*iter] == false && capacity[current_number][*iter] == 1 &&
          *iter != 0) {
        parent[*iter] = current_number;
        Queue.push(*iter);
      }
    }
  }
  return;
}
bool find_a_path(int goal_number) {
  bool s[300] = {false};
  BFS(0, goal_number, s);
  return s[goal_number];
}
void heapify(int arr[], int n, int i) {
  int largest = i;
  int l = 2 * i + 1;
  int r = 2 * i + 2;
  if (l < n && arr[l] > arr[largest]) largest = l;
  if (r < n && arr[r] > arr[largest]) largest = r;
  if (largest != i) {
    swap(arr[i], arr[largest]);
    heapify(arr, n, largest);
  }
}
void heapSort(int arr[], int n) {
  for (int i = n / 2 - 1; i >= 0; i--) heapify(arr, n, i);
  for (int i = n - 1; i >= 0; i--) {
    swap(arr[0], arr[i]);
    heapify(arr, i, 0);
  }
}
void test(bool d[]) { d[0] = true; }
int main() {
  int m, n;
  cin >> m;
  int boys[m];
  for (int i = 0; i < m; i++) {
    cin >> boys[i];
  }
  cin >> n;
  int girls[n];
  for (int i = 0; i < n; i++) {
    cin >> girls[i];
    V[m + i + 1].push_back(m + n + 1);
    capacity[m + i + 1][m + n + 1] = 1;
  }
  heapSort(boys, m);
  heapSort(girls, n);
  int cap;
  for (int i = 0; i < m; i++) {
    V[0].push_back(i + 1);
    V[i + 1].push_back(0);
    capacity[0][i + 1] = 1;
    capacity[i + 1][0] = 0;
    cap = boys[i];
    for (int j = 0; j < n; j++) {
      if (girls[j] - cap > 1) {
        break;
      } else if (std::abs(girls[j] - cap) <= 1) {
        V[i + 1].push_back(j + m + 1);
        capacity[i + 1][j + m + 1] = 1;
        V[j + m + 1].push_back(i + 1);
      }
    }
  }
  int total_pair = 0;
  while (true) {
    if (find_a_path(m + n + 1) == true) {
      total_pair++;
      int u = m + n + 1;
      while (parent[u] != -1) {
        int v = parent[u];
        capacity[v][u] = 0;
        capacity[u][v] = 1;
        u = v;
      }
    } else {
      break;
    }
    for (int i = 0; i < 300; i++) {
      parent[i] = -1;
    }
  }
  cout << total_pair;
}
