#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  vector<string> blueCards(m);
  for (int i = 0; i < m; i++) {
    cin >> blueCards.at(i);
  }
  int n;
  cin >> n;
  vector<string> redCards(n);
  for (int i = 0; i < n; i++) {
    cin >> redCards.at(i);
  }
  int ans = 0;
  string current;
  int times = n;
  if (n < m) times = m;
  for (int i = 0; i < m; i++) {
    current = blueCards.at(i);
    int tmpAns = 0;
    for (int j = 0; j < times; j++) {
      if (j < blueCards.size() && blueCards.at(j) == current) tmpAns++;
      if (j < redCards.size() && redCards.at(j) == current) tmpAns--;
    }
    if (tmpAns > ans) ans = tmpAns;
  }
  cout << ans << endl;
}
