#include <bits/stdc++.h>
using namespace std;
int main() {
  int M, N, i, j;
  cin >> N;
  vector<string> s(N);
  for (i = 0; i < N; i++) {
    cin >> s.at(i);
  }
  cin >> M;
  vector<string> t(M);
  for (i = 0; i < M; i++) {
    cin >> t.at(i);
  }
  vector<int> score;
  string x;
  for (i = 0; i < N; i++) {
    x = s.at(i);
    int count1 = 0;
    int count2 = 0;
    for (j = 0; j < N; i++) {
      if (x == s.at(j)) count1++;
    }
    for (j = 0; j < M; i++) {
      if (x == t.at(j)) count2--;
    }
    score.push_back(count1 + count2);
  }
  int max_value = *max_element(score.begin(), score.end());
  cout << max_value << endl;
}
