#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> s;
  int n;
  cin >> n;
  while (n--) {
    string str;
    cin >> str;
    s[str]++;
  }
  int m;
  cin >> m;
  while (m--) {
    string str;
    cin >> str;
    s[str]--;
  }
  int ans = 0;
  for (auto it : s) {
    max(ans, it.second);
  }
  cout << ans << endl;
}
