#include <bits/stdc++.h>
using namespace std;
int main() {
  uint bule_count;
  cin >> bule_count;
  string input_str;
  map<string, int> card;
  for (uint i = 0; bule_count > i; i++) {
    cin >> input_str;
    if (card.count(input_str)) {
      card.at(input_str)++;
    } else {
      card[input_str] = 1;
    }
  }
  uint red_count;
  cin >> red_count;
  for (uint i = 0; red_count > i; i++) {
    cin >> input_str;
    if (card.count(input_str)) {
      card.at(input_str)--;
    } else {
      card[input_str] = -1;
    }
  }
  string max_key;
  int max_val = 0;
  for (auto itr = card.begin(); itr != card.end(); ++itr) {
    if (max_val < itr->second) {
      max_key = itr->first;
      max_val = itr->second;
    }
  }
  cout << card.at(max_key) << endl;
}
