#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, -1, 0, 1, -1, -1, 1, 1};
static const int INF = 1000000010;
string bl[110];
string re[110];
int main() {
  int n, m;
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    cin >> bl[i];
  }
  cin >> m;
  for (int i = (0); i < (m); ++i) {
    cin >> re[i];
  }
  int ans = 0;
  for (int i = (0); i < (n); ++i) {
    string tango = bl[i];
    int num = 0;
    for (int j = (0); j < (n); ++j) {
      if (tango == bl[j]) {
        num++;
      }
    }
    for (int k = (0); k < (m); ++k) {
      if (tango == re[k]) {
        num--;
      }
    }
    if (ans < num) {
      ans = num;
    }
  }
  cout << ans << endl;
  return 0;
}
