// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std ;

#define ll long long

inline int D(){

    int t ;

    scanf( "%d" , &t ) ;

    return t ;

}

inline ll LLD(){

    ll t ;

    scanf( "%lld" , &t ) ;

    return t ;

}//#########################################



bool isPrime(ll n){

    for(ll i = 2; i <= n / i; ++i)

        if(n % i == 0)

            return 0;

    return n > 1;

}





vector<ll> getDivisors(ll n){

    vector<ll> ret;

    for(int i = 1; i <= n / i; ++i){

        if(n % i == 0){

            ret.push_back(i);

            if(n / i != i)

                ret.push_back(n / i);

        }

    }

    return ret;

}







ll GCD(ll a, ll b){

    return b ? GCD(b, a % b) : a;

}



ll LCM(ll a, ll b){

    return a / GCD(a, b) * b;

}



vector<ll> ret;



vector<ll> getFactors(ll n){

    // vector<ll> ret;

    for(ll i = 2; i <= n / i; ++i)

        while(n % i == 0){

            ret.push_back(i);

            n /= i;

        }



    if(n != 1){

        ret.push_back(n);

    }

    return ret;

}

const int N = 1e6 + 5;

int vst[N], cnt[N];

vector<int> primes;

void seive(){

    for(int i = 2; i < N; ++i){

        if(vst[i])

            continue;

        primes.push_back(i);

        for(ll j = 1LL * i * i; j < N; j +=i)

            vst[j] = 1;

    }

}



// Modified sieve for number of divisors

int cnt1[N];

void modSeive(){

    for(int i = 1; i < N; ++i){

        for(int j = i; j < N; j += i)

            ++cnt1[j];

    }

}



// Modified sieve for number of prime factors

int cnt2[N];

void mod2Sieve(){

    for(int i = 2; i < N; ++i){

        if(vst[i])

            continue;

        for(ll j = i; j < N; j +=i){

            vst[j] = 1;

            int cntP = 0;// calculate the power of i exists in j

            int curr = j;

            while (curr % i == 0) {

                ++cntP;

                curr /= i;

            }

            cnt2[j] += cntP;

        }

    }

}

//####################################################################################################







map<string,int>a;

int main() {



    int n = D();



    string s;

    for (int i = 0; i < n; i++) {

        cin >> s;

        a[s]++;

    }

    int m=D();

    for (int i = 0; i < m; i++) {

        cin >> s;

        a[s]--;

    }

    int mx=0;

    for (std::map<string,int>::iterator it=a.begin(); it!=a.end(); ++it){

        mx=max(mx,it->second);



}

    cout<<mx;











}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char ch[205][11],str[11];

int s[205];

int main()

{

	int a,b,k=0;

	scanf("%d",&a);

	getchar();

	for(int i=0;i<a;i++)

	{

		scanf("%s",str);

		int flag=0;

		for(int j=0;j<k;j++)

		{

			if(strcmp(ch[j],str)==0)

			{

				flag=1;

				s[j]++;

				break;

			}

		}

		if(flag==0)

		{

			strcpy(ch[k],str);

			s[k]++;

			k++;

		}

	}

	scanf("%d",&b);

	getchar();

	for(int i=0;i<b;i++)

	{

		scanf("%s",str);

		int flag=0;

		for(int j=0;j<k;j++)

		{

			if(strcmp(ch[j],str)==0)

			{

				flag=1;

				s[j]--;

				break;

			}

		}

		if(flag==0)

		{

			strcpy(ch[k],str);

			s[k]--;

			k++;

		}

	}

	int max=0;

	for(int i=0;i<k;i++)if(s[i]>max)max=s[i];

	printf("%d\n",max);

}

// Fastest known solution for this problem: