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