#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, b, c = 0, x, y, m = 0, n, k, p, h = 0, t1, d;
  string a[100], s[100];
  int g[100];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> p;
  for (i = 0; i < p; i++) {
    cin >> s[i];
  }
  for (i = 0; i < n; i++) {
    if (a[i] != "0") {
      m = 1;
      for (j = i + 1; j < n; j++) {
        if (a[i] == a[j]) {
          m++;
          a[j] = '0';
        }
      }
    }
    for (k = 0; k < p; k++) {
      if (a[i] != "0") {
        if (a[i] == s[k]) {
          h++;
        }
      }
    }
    g[c] = m - h;
    c++;
    m = 1;
    h = 0;
  }
  d = c;
  sort(g, g + d);
  if (g[d - 1] <= 0) {
    cout << "0" << endl;
  } else
    cout << g[d - 1] << endl;
  return 0;
}
