#include <bits/stdc++.h>
using namespace std;
int main(int, char**) {
  int n, m;
  map<string, int> scores;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string v;
    cin >> v;
    if (scores.find(v) == scores.end())
      scores[v] = 1;
    else
      scores[v]++;
  }
  cin >> m;
  for (int i = 0; i < m; ++i) {
    string v;
    cin >> v;
    if (scores.find(v) == scores.end())
      scores[v] = -1;
    else
      scores[v]--;
  }
  cout << max(0, scores.rbegin()->second) << endl;
}
