#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, count, ma;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s.at(i);
  cin >> m;
  vector<string> t(m);
  for (int i = 0; i < m; i++) cin >> t.at(i);
  ma = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (s.at(i) == s.at(j)) count++;
    }
    for (int j = 0; j < m; j++) {
      if (s.at(i) == t.at(j)) count--;
    }
    ma = max(count, ma);
  }
  cout << ma << endl;
}
