#include <bits/stdc++.h>
using namespace std;
int main() {
  string line;
  vector<string> wordsblue(1000);
  vector<string> wordsred(1000);
  int N, M, i, j, k;
  int count, countdef;
  countdef = 0;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> line;
    wordsblue.push_back(line);
  }
  cin >> M;
  for (i = 0; i < M; i++) {
    cin >> line;
    wordsred.push_back(line);
  }
  for (i = 0; i < N; i++) {
    count = 0;
    for (j = 0; j < N; j++) {
      if (wordsred[i] == wordsred[j]) {
        count += 1;
      }
    }
    for (k = 0; k < M; k++) {
      if (wordsred[i] == wordsblue[k]) {
        count -= 1;
      }
    }
    if (count > countdef) {
      countdef = count;
    }
  }
  printf("%d", countdef);
}
