#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
typedef unsigned long long ull;
const int INF=0x3f3f3f3f;
const int N=2e5+5;
using namespace std;

ll t,n,m;
int dp[N]={0},vis[N]={0};
map<string,int> mp;
string s;
int maxn=-INF;
int main(){
	cin>>n;
	while(n--){
		cin>>s;
		mp[s]++;
	}
	cin>>n;
	while(n--){
		cin>>s;
		mp[s]--;
	}
	for(map<string,int>::iterator it = mp.begin();it!=mp.end();++it){
        int temp = (*it).second;
        maxn=max(maxn,temp);
    }
    cout<<maxn<<endl;
    return 0;
}