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

int main()
{
	int n;
	cin >> n;
	map<string, int> M;
	string in;
	for (int i = 0; i < n; ++i)
	{
		cin >> in;
		++M[in];
	}
	int m;
	cin >> m;
	for (int i = 0; i < m; ++i)
	{
		cin >> in;
		--M[in];
	}
	int ans = 0;
	for (auto o : M)
	{
		ans = max(ans, o.second);
	}
	cout << ans << endl;
	return 0;
}