#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, ans = -100;
  cin >> N;
  string s[N];
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  cin >> M;
  string t[M];
  for (int i = 0; i < N; i++) {
    cin >> t[i];
  }
  for (int i = 0; i < N + M; i++) {
    int p = 0;
    if (i < N) {
      for (int n = 0; n < N; n++) {
        if (s[i] == s[n]) p++;
      }
      for (int m = 0; m < M; m++) {
        if (s[i] == t[m]) p--;
      }
    } else {
      for (int n = 0; n < N; n++) {
        if (t[i - N] == s[n]) p++;
      }
      for (int m = 0; m < M; m++) {
        if (t[i - N] == t[m]) p--;
      }
    }
    if (ans < p) ans = p;
  }
  cout << ans;
}
