#include <bits/stdc++.h>
using std::string;
int main(void) {
  std::map<string, int> coin;
  int n, m;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::string str;
    std::cin >> str;
    auto it = coin.find(str);
    if (it == coin.end()) {
      coin[str] = 0;
      it = coin.find(str);
    }
    ++(it->second);
  }
  std::cin >> m;
  for (int i = 0; i < m; ++i) {
    std::string str;
    std::cin >> str;
    auto it = coin.find(str);
    if (it == coin.end()) {
      coin[str] = 0;
      it = coin.find(str);
    }
    --(it->second);
  }
  int ret = 0;
  for (const auto& it : coin) {
    ret = std::max<int>(ret, it.second);
  }
  std::cout << ret << std::endl;
  return 0;
}
