#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; ++i) cin >> s[i];
  int m;
  cin >> m;
  string t[m];
  for (int i = 0; i < m; ++i) cin >> t[i];
  map<string, int> a;
  for (int i = 0; i < n; ++i) {
    a[s[i]]++;
  }
  for (int i = 0; i < m; ++i) {
    a[t[i]]--;
  }
  int mi = 0;
  for (auto itr = a.begin(); itr != a.end(); ++itr) {
    mi = max(mi, itr->second);
  }
  cout << mi << endl;
  return 0;
}
