#include <bits/stdc++.h>
using namespace std;
int getnum() {
  char C;
  while (!isdigit(C = getchar()))
    ;
  int n = C - '0';
  while (isdigit(C = getchar())) n = n * 10 + C - '0';
  return n;
}
int main() {
  string S;
  map<string, int> ans{};
  int N = getnum();
  while (N--) {
    cin >> S;
    ans[S]++;
  }
  N = getnum();
  while (N--) {
    cin >> S;
    ans[S]--;
  }
  int maxans = 0;
  for (auto itr = ans.begin(); itr != ans.end(); itr++)
    maxans = max(maxans, itr->second);
  printf("%d\n", maxans);
}
