#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  map<string, int> blue;
  string word;
  for (int i = 0; i < n; ++i) {
    cin >> word;
    auto itr = blue.find(word);
    if (itr != blue.end())
      blue[word] += 1;
    else
      blue[word] = 1;
  }
  cin >> m;
  map<string, int> red;
  for (int i = 0; i < m; ++i) {
    cin >> word;
    auto itr = red.find(word);
    if (itr != red.end())
      red[word] += 1;
    else
      red[word] = 1;
  }
  for (auto itr = blue.begin(); itr != blue.end(); ++itr) {
    auto it = red.find(itr->first);
    if (it != red.end()) itr->second -= red[itr->first];
  }
  int max = 0;
  for (auto itr = blue.begin(); itr != blue.end(); ++itr) {
    max = (max, itr->second);
  }
  cout << max << endl;
}
