#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<string> add(n);
  for (int i = 0; i < n; i++) {
    cin >> add[i];
  }
  int m;
  cin >> m;
  vector<string> minus(m);
  for (int i = 0; i < m; i++) {
    cin >> minus[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (add.at(i) == add.at(j)) {
        count++;
      }
    }
    for (int j = 0; j < m; j++) {
      if (add.at(i) == minus.at(j)) {
        count--;
      }
    }
    if (count > ans) ans = count;
  }
  cout << ans << endl;
}
