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