#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return x * f;
}
const int N = 110;
string a[N], b[N];
int main() {
  int n, m;
  scanf("%d\n", &n);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  scanf("%d\n", &m);
  for (int i = 1; i <= m; ++i) cin >> b[i];
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    int cnt = 0;
    for (int j = 1; j <= n; ++j) {
      if (a[i] == a[j]) ++cnt;
    }
    for (int j = 1; j <= m; ++j) {
      if (a[i] == b[j]) --cnt;
    }
    ans = max(ans, cnt);
  }
  printf("%d\n", ans);
  return 0;
}
