#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; ++i) {
    cin >> s[i];
  }
  int M;
  cin >> M;
  vector<string> t(M);
  for (int i = 0; i < M; ++i) {
    cin >> t[i];
  }
  int res = 0;
  for (int i = 0; i < N; ++i) {
    int tmp = 0;
    for (auto&& blue : s) {
      tmp += (s[i] == blue);
    }
    for (auto&& red : t) {
      tmp -= (s[i] == red);
    }
    if (res < tmp) {
      res = tmp;
    }
  }
  cout << res << endl;
  return 0;
}
