#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[110], t[110];
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  cin >> m;
  for (int i = 0; i < m; i++) cin >> t[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int x = 0; x < n; x++)
      if (s[i] == s[x]) count++;
    for (int y = 0; y < m; y++)
      if (s[i] == t[y]) count--;
    ans = max(ans, count);
  }
  cout << ans << endl;
  return 0;
}
