#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int M;
  string Word;
  cin >> N;
  vector<string> BlueWord(N, "");
  vector<int> BlueCtr(N, 0);
  int Bctr = 0;
  bool NewWord;
  int MaxNo = 0;
  for (int i = 0; i < N; i++) {
    NewWord = true;
    cin >> Word;
    for (int j = 0; j < Bctr; j++) {
      if (BlueWord.at(j) == Word) {
        BlueCtr.at(j) += 1;
        NewWord = false;
        break;
      }
    }
    if (NewWord == true) {
      BlueWord.at(Bctr) = Word;
      BlueCtr.at(i) = 1;
      Bctr += 1;
    }
  }
  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> Word;
    for (int j = 0; j < Bctr; j++) {
      if (BlueWord.at(j) == Word) {
        BlueCtr.at(j) -= 1;
        continue;
      }
    }
  }
  for (int i = 0; i < Bctr; i++) {
    if (BlueCtr.at(i) > MaxNo) {
      MaxNo = BlueCtr.at(i);
    }
  }
  cout << MaxNo;
}
