#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define bitsz(x) int(__builtin_popcount(x))
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define INF 2e9
#define LINF 1e18
#define mod 1000000007
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
typedef long long ll;
typedef pair<int, int> P;
const int di[4] = {1,0,-1,0};
const int dj[4] = {0,1,0,-1};


int main() {
    int n; cin >> n;

    map<string, int> mp;
    rep(i,n) {
        string s; cin >> s;
        mp[s]++;
    }
    int m; cin >> m;
    rep(i,m) {
        string t; cin >> t;
        mp[t]--;
    }

    int ans = -10000;
    for (auto x : mp) {
        chmax(ans, x.second);
    }
    if (ans >= 0) cout << ans << endl;
    else cout << 0 << endl;
} 
#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,M;
    int count = 0;
    int score = 0;
    cin >> N;
    vector<string> s(N);
    for(int i=0;i<N;i++){
        cin >> s.at(i);
    }
    cin >> M;
    vector<string> t(M);
    for(int i=0;i<M;i++){
        cin >> t.at(i);
    }
    for(int i=0;i<N;i++){
        count = 0;
        for(int j=0;j<N;j++){
            if(s.at(i) == s.at(j)) count++;
        }
        for(int j=0;j<M;j++){
            if(s.at(i) == t.at(j)) count--;
        }
        score = max(score,count);
    }
    cout << score << endl;


}