#include <iostream>
#include <map>
using namespace std;

int main()
{
  map<string, int> card;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    card[s]++;
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    string t;
    cin >> t;
    card[t]--;
  }
  int ans(0);
  for (auto&& c : card) {
    ans = max(ans, c.second);
  }
  cout << ans << endl;
}
