#include <iostream> 
#include <string> 
#include <map>
using namespace std;
 
map<string, int>mp1, mp2;
 
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    mp1[s]+=1;
  }
  int m;
  cin>>m;
  for(int i = 0; i < n; i++){
	string s ;
	cin>>s ;
	mp2[s]+=1 ;
   }
  	map<string, int> :: iterator it ;
	int mx = 0 ;
	for(it = mp1.begin(); it != mp1.end(); it++){
		mx = max(mx, mp1[it->first] - mp2[it->first]) ;
	}
	cout<<mx<<endl ;
	return 0 ;
}
#include <iostream> 
#include <string> 
using namespace std;

map<string, int>mp1, mp2;

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    mp1[s]+=1;
  }
  int m;
  cin>>m;
  for(int i = 0; i < n; i++){
	string s ;
	cin>>s ;
	mp2[s]+=1 ;
   }
  	map<string, int> :: iterator it ;
	int mx = 0 ;
	for(it = mp1.begin(); it != mp1.end(); it++){
		mx = max(mx, mp1[it->first] - mp2[it->first]) ;
	}
	cout<<mx<<endl ;
	return 0 ;
}


