#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<string> r(100);
  vector<string> b(100);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> r.at(i);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> b.at(i);
  }
  int cMax = -m;
  int count;
  for (int i = 0; i < n; i++) {
    count = 0;
    for (int j = 0; j < n; j++) {
      if (r.at(j) == r.at(i)) count++;
    }
    for (int j = 0; j < m; j++) {
      if (b.at(j) == r.at(i)) count--;
    }
    cMax = max(cMax, count);
  }
  cout << cMax << endl;
}
