#include <bits/stdc++.h>
using namespace std;

int main() {
  int M,N,i,j;
  cin>>N;
  vector<string> s(N);
  for(i=0;i<N;i++){
    cin>>s.at(i);
  }
  cin>>M;
  vector<string> t(M);
  for(i=0;i<M;i++){
    cin>>t.at(i);
  }
  vector<int> score;
  string x;
  string x_bef;
  sort(s.start(),s.end());
  sort(t.start(),t.end());
  for(i=0;i<N;i++){
    x=s.at(i);
    if(x==x_bef){continue;}
    int count1=0;
    int count2=0;
    for(j=0;j<N;i++){
      if(x==s.at(j))count1++;
    }
    for(j=0;j<M;i++){
      if(x==t.at(j))count2--;
    }
    int ss;
    if ((count1+count2)<0) ss=0;
    else ss=count1+count2;
    score.push_back(ss);
    x_bef=x;
  }

  int max_value=*max_element(score.begin(), score.end());
  cout<<max_value<<endl;

}
