#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int toy = 0;
  int N;
  cin >> N;
  std::string array1[N - 1];
  for (int i = 0; i < N; i++) {
    cin >> array1[i];
  }
  int M;
  cin >> M;
  std::string array2[M - 1];
  for (int t = 0; t < M; t++) {
    cin >> array2[t];
  }
  for (int a = 0; a < N - 1; a++) {
    for (int b = 0; b < N - 1; b++) {
      if (array1[a] == array1[b]) {
        toy += 1;
      }
    }
    for (int c = 0; c < M - 1; c++) {
      if (array1[a] == array2[c]) {
        toy -= 1;
      }
    }
    if (ans <= toy) {
      ans = toy;
    }
    toy = 0;
  }
  toy = 0;
  for (int d = 0; d < M - 1; d++) {
    for (int e = 0; e < N - 1; e++) {
      if (array2[d] == array1[e]) {
        toy += 1;
      }
    }
    for (int f = 0; f < M - 1; f++) {
      if (array2[d] == array2[f]) {
        toy -= 1;
      }
    }
    if (ans <= toy) {
      ans = toy;
    }
    toy = 0;
  }
  cout << ans << "\n";
  return 0;
}
