#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0, M = 0;
  int counter = 0;
  int ans = -100;
  vector<string> blue(1000);
  vector<string> red(1000);
  cin >> N;
  for (int i = 0; i < (int)(N); i++) {
    cin >> blue.at(i);
  }
  cin >> M;
  for (int i = 0; i < (int)(M); i++) {
    cin >> red.at(i);
  }
  for (int i = 0; i < (int)(blue.size()); i++) {
    counter = 0;
    for (int j = 0; j < (int)(blue.size()); j++) {
      if (blue.at(j) == blue.at(i)) counter++;
    }
    for (int k = 0; k < (int)(red.size()); k++) {
      if (red.at(k) == blue.at(i)) counter--;
    }
    if (counter > ans) ans = counter;
  }
  cout << ans << endl;
}
