#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;

int N, M, ans;
string s[100], t;
map<string, int> mp;

int main() {
    cin >> N;
    rep(i, N) {
        cin >> s[i];
        mp[s[i]]++;
    }
    cin >> M;
    rep(i, M) {
        cin >> t;
        mp[t]--;
    }

    rep(i, N) {
        ans = max(ans, mp[s[i]]);
    }
    cout << ans << endl;
}