#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, subject = 0, count, tmp = 0, max = 0;
  vector<string> s(101), t(101), search(101);
  string str;
  cin >> N;
  for (int i = 0; i < (int)N; i++) {
    cin >> s.at(i);
    search.at(i) = s.at(i);
    for (int j = 0; j < (int)N; j++) {
      if (search.at(i) == s.at(j) && i != j) {
        search.at(i) = "";
        continue;
      }
    }
    subject = N;
    for (int k = 0; k < (int)N; k++) {
      if (search.at(k).size() == 0) {
        search.at(k) = search.at(k + 1);
        search.at(k + 1) = search.at(k + 2);
        subject--;
      }
    }
  }
  cin >> M;
  for (int l = 0; l < (int)M; l++) {
    cin >> t.at(l);
  }
  for (int i = 0; i < (int)subject + 1; i++) {
    str = search.at(i);
    tmp = max;
    count = 0;
    for (int j = 0; j < (int)N; j++) {
      if (s.at(j) == str) {
        count++;
      }
    }
    for (int k = 0; k < (int)M; k++) {
      if (t.at(k) == str) {
        count--;
      }
    }
    if (tmp < count) {
      max = count;
    }
  }
  cout << max << endl;
}
