#include <bits/stdc++.h>
using namespace std;
int main() {
  int g[100];
  int b[100];
  int n, m;
  int com(0), result(0), temp(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> g[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (b[i] > b[j]) {
        temp = b[i];
        b[i] = b[j];
        b[j] = temp;
      }
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = i; j < m; j++) {
      if (g[i] > g[j]) {
        temp = g[i];
        g[i] = g[j];
        g[j] = temp;
      }
    }
  }
  if (m > n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (abs(b[i] - g[j]) <= 1) {
          result++;
          b[i] = -1;
          g[j] = -1;
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        if (abs(b[j] - g[i]) <= 1) {
          result++;
          b[j] = -1;
          g[i] = -1;
          break;
        }
      }
    }
  }
  cout << result;
  return 0;
}
