#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, ans = 0;
  cin >> N;
  string *s;
  s = (string *)malloc(N);
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  cin >> M;
  string *t;
  t = (string *)malloc(M);
  for (int i = 0; i < M; i++) {
    cin >> t[i];
  }
  for (int i = 0; i < N; i++) {
    int x = 0;
    for (int j = 0; j < N; j++) {
      if (s[i] == s[j]) {
        x++;
      }
    }
    for (int j = 0; j < N; j++) {
      if (s[i] == t[j]) {
        x--;
      }
    }
    ans = max(ans, x);
  }
  cout << ans << endl;
  free(s);
  free(t);
}
