#include <bits/stdc++.h>
using namespace std;
int N, M, T;
string A[100], B[100];
vector<string> S;
int main(void) {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    S.push_back(A[i]);
  }
  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> B[i];
    S.push_back(B[i]);
  }
  for (int i = 0; i < S.size(); i++) {
    int t = 0;
    for (int j = 0; j < N; j++)
      if (A[j] == S[i]) t++;
    for (int j = 0; j < M; j++)
      if (B[j] == S[i]) t--;
    if (t > T) T = t;
  }
  printf("%d\n", T);
}
