#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  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 < M; ++i) {
    cin >> t[i];
  }
  int max = 0;
  for (int i = 0; i < N; ++i) {
    int count_plus = 0;
    int count_minus = 0;
    for (int j = 0; j < N; ++j) {
      if (s[i] == s[j]) {
        count_plus += 1;
      }
      if (s[i] == t[j]) {
        count_minus -= 1;
      }
    }
    if (count_plus + count_minus > max) {
      max = count_plus + count_minus;
    }
  }
  cout << max << endl;
  return 0;
}
