 #include <iostream>
#include <string>
#include <map>
using namespace std;


bool isContained(map<string, int> mp, string key){
    for(map<string,int>::iterator itr = mp.begin(); itr != mp.end(); ++itr){
        if( itr->first == key ){
            return true;
        }            
    }
    return false;
}

int main(void){
    const int N,M;
    int max=0;
    string N_card[N];
    string M_card[M];
    map<string,int> mp;

    cin >> N;
    for (int i=0; i<N; i++){
        cin >> N_card[i];
    }
   cin >> M;
    for (int i=0; i<M; i++){
        cin >> M_card[i];
    }

    for (int i=0; i < N; i++){
        if (isContained(mp,N_card[i])){
            mp[s[i]]++;
        }
        else{
            mp[s[i]] = 1;
        }
    }
    for(int i=0; i < M; i++){
        if (isContained(mp,M_card[i])){
            mp[s[i]]--;
        }
        else{
            mp[s[i]] = 0;
        }
    }
    for (itr = mp.begin(); itr!=mp.end(); itr++){
        if(itr ->second > max){
            max = itr -> second;
        }
    }
    cout << max;
   
return 0;
}
