#include <bits/stdc++.h>
using namespace std;

int main() {
  int B, R;
  cin >> B;
  map<string, int> m;
  for (int i = 0; i < B; i++) {
    string s;
    cin >> s;
    m[s] += 1;
  }
  
  cin >> R;
  for (int i = 0; i < R; i++) {
    string s;
    cin >> s;
    m[s] -= 1;
  }
  
  int pos = 0;
  for (auto e : m) {
    pos = max(pos, e.second);
  }
  
  cout << pos << endl;
}