#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> blue(n);
  for (int i = 0; i < n; i++) {
    cin >> blue[i];
  }
  int m;
  cin >> m;
  vector<string> red(m);
  for (int i = 0; i < m; i++) {
    cin >> red[i];
  }
  int ans = 0;
  for (string t : blue) {
    int buf = 0;
    for (string s : blue)
      if (t == s) {
        buf++;
      }
    for (string s : red)
      if (t == s) {
        buf--;
      }
    ans = max(ans, buf);
  }
  cout << ans << endl;
  return 0;
}
