#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int cnt = 0;
  string x;
  string S[100], T[100];
  cin >> N;
  for (int i = 0; i < N; i++) cin >> S[i];
  cin >> M;
  for (int i = 0; i < M; i++) cin >> T[i];
  for (int i = 0; i < N; i++) {
    int cnt_S = 0;
    int cnt_T = 0;
    x = S[i];
    for (int j = 0; j < N; j++) {
      if (x == S[j]) cnt_S++;
    }
    for (int j = 0; j < M; j++) {
      if (x == T[j]) cnt_T++;
    }
    cnt = max(cnt, cnt_S - cnt_T);
  }
  cout << cnt << endl;
  return 0;
}
