#include <bits/stdc++.h>
using namespace std;
string s[101];
int s2[101];
string t[101];
int main() {
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    s2[i] = 0;
  }
  cin >> m;
  for (int j = 0; j < m; j++) cin >> t[j];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (s[i] == s[j]) s2[i] += 1;
    for (int k = 0; k < m; k++)
      if (s[i] == t[k]) s2[i] -= 1;
  }
  sort(s2, s2 + 101);
  reverse(s2, s2 + 101);
  if (s2[0] < 0)
    cout << 0;
  else
    cout << s2[0];
}
