#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s.at(i);
  }
  int M;
  cin >> M;
  vector<string> t(M);
  for (int i = 0; i < M; i++) {
    cin >> t.at(i);
  }
  int max = -100;
  for (int i = 0; i < N; i++) {
    int sum = 0;
    for (int j = 0; j < N; j++) {
      if (s.at(i) == s.at(j)) {
        sum++;
      }
    }
    int sum1 = 0;
    for (int k = 0; k < M; k++) {
      if (s.at(i) == t.at(k)) {
        sum1++;
      }
    }
    if (sum - sum1 > max) {
      max = sum - sum1;
    }
  }
  if (max > 0) {
    cout << max << endl;
  } else {
    cout << 0 << endl;
  }
}
