#include <bits/stdc++.h>
using namespace std;
map<string, int> m1;
int main() {
  int n, m;
  string x;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    m1[x]++;
  }
  cin >> m;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    m1[x]--;
  }
  cout << max(0, (*m1.rbegin()).second);
  return 0;
}
