#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, P = 0, max, cnt;
  string most_word;
  cin >> N;
  vector<string> N_s(N);
  for (int i = 0; i < N; i++) {
    cin >> N_s.at(i);
  }
  for (int i = 0; i < N_s.size(); i++) {
    for (int j; j < N_s.size(); j++) {
      if (N_s.at(i) == N_s.at(j)) {
        cnt++;
      }
      cnt--;
      if (i == 0)
        max = cnt;
      else if (cnt > max) {
        most_word = N_s.at(i);
      }
    }
  }
  cin >> M;
  vector<string> M_t(M);
  for (int i = 0; i < M; i++) {
    cin >> M_t.at(i);
  }
  for (int i = 0; i < N; i++) {
    if (N_s.at(i) == most_word) P++;
  }
  for (int j = 0; j < M; j++) {
    if (M_t.at(j) == most_word) P--;
  }
  cout << P << endl;
}
