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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N, M;
    cin >> N;
    map<string, ll> n, m;
    set<string> S;
    ll maxi = 0;
    rep(i, N) {
        string temp;
        cin >> temp;
        n[temp]++;
        S.insert(temp);
    }
    cin >> M;
    rep(i, M) {
        string temp;
        cin >> temp;
        m[temp]++;
        S.insert(temp);
    }
    iter(s, S) maxi = max(maxi, n[s] - m[s]);
    cout << maxi << endl;
    return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;

int main(){

  int N, M;
  cin >> N;
  vector<string> vec1(N);
  for (int i=0; i<N; i++){
    cin >> vec1.at(i);
  }
  cin >> M;
  vector<string> vec2(M);
  for (int i=0; i<M; i++){
    cin >> vec2.at(i);
  }

  int max=0;
  for (int i=0; i<N; i++){
    int sum=0;
    for (int j=0; j<N; j++){
      if (vec1.at(i)==vec1.at(j)){
        sum++;
      }
    }
    for (int k=0; k<M; k++){
      if (vec1.at(i)==vec2.at(k)){
        sum--;
      }
    }
    if (sum>max){
      swap(sum, max);
    }
  }

  cout << max << endl;
}
