#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> Blue(N);
  for (int i = 0; i < N; i++) {
    cin >> Blue.at(i);
  }
  int M;
  cin >> M;
  vector<string> Red(M);
  for (int i = 0; i < M; i++) {
    cin >> Red.at(i);
  }
  int Answer = 0;
  for (int i = 0; i < N; i++) {
    int count = 0;
    for (int j = 0; j < N; j++) {
      if (Blue.at(i) == Blue.at(j)) {
        count++;
      }
    }
    for (int j = 0; j < M; j++) {
      if (Blue.at(i) == Red.at(j)) {
        count--;
      }
    }
    if (count > Answer) {
      Answer = count;
    }
  }
  cout << Answer << endl;
}
