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