#include <bits/stdc++.h>
using namespace std;
map<string, int> cnt;
set<string> set1;
int main() {
  int n, m;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    cnt[s]++;
    set1.insert(s);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> s;
    cnt[s]--;
    set1.insert(s);
  }
  int ans = 0;
  set<string>::iterator it = set1.begin();
  for (; it != set1.end(); it++) {
    ans = max(ans, cnt[*it]);
  }
  cout << ans << endl;
  return 0;
}
