#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, max = 0;
  cin >> n;
  string temp, str;
  map<string, int> my;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    map<string, int>::iterator it;
    it = my.begin();
    while (it != my.end()) {
      if (it->first == temp) {
        my[temp]++;
        break;
      }
      it++;
    }
    if (it == my.end()) {
      my[temp] = 1;
    }
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> str;
    map<string, int>::iterator it;
    it = my.begin();
    while (it != my.end()) {
      if (it->first == str) {
        my[str]--;
        break;
      }
      it++;
    }
  }
  map<string, int>::iterator it;
  it = my.begin();
  while (it != my.end()) {
    if (it->second > max) max = it->second;
    it++;
  }
  printf("%d", max);
}
