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