#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    ll n;
    cin >> n;
    vector<pair<string, ll>> st;
    rep(i, n) {
        string s;
        cin >> s;
        st.push_back({s, 1});
    }

    ll m;
    cin >> m;
    rep(i, m) {
        string s;
        cin >> s;
        st.push_back({s, -1});
    }

    sort(st.begin(), st.end());

    // rep(i, n + m) { cout << st[i].fi << endl; }
    ll ans = 0, cnt = 0;

    rep(i, n + m) {
        if (st[i].fi == st[i + 1].fi) {
            cnt += st[i].se;
        } else {
            cnt += st[i].se;
            // cout << cnt << endl;
            chmax(ans, cnt);
            cnt = 0;
        }
        if (i == n + m - 1 && cnt != 0) chmax(ans, cnt);
    }

    cout << ans << "\n";
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG

int main() {
    int n, m;
    cin >> n;
    vector<string> vec_n(n);
    rep(i, n) cin >> vec_n[i];
    cin >> m;
    vector<string> vec_m(100);
    rep(i, m) cin >> vec_m[i];
    
    int max = -100;
    rep(i, n){
        int cnt = 0;
        rep(j, n){
            if(vec_n[i] == vec_n[j]) cnt++;
        }
        rep(j, m){
            if(vec_n[i] == vec_m[j]) cnt--;
        }
        
        if(cnt > max) max = cnt;
    }
    
    
    if(max < 0){
        cout << 0 << endl;
    }else cout << max << endl;
}