#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 ben = 0;
  for (int i = 0; i < N; i++) {
    string x = blue.at(i);
    int ben_at_x = 0;
    for (int j = 0; j < N; j++) {
      if (blue.at(j) == x) {
        ben_at_x++;
      }
    }
    for (int j = 0; j < M; j++) {
      if (red.at(j) == x) {
        ben_at_x--;
      }
    }
    ben = max(ben, ben_at_x);
  }
  cout << ben << endl;
}
