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