#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <iomanip>
#define intt long long

int main() {
	intt N; std::cin >> N;
	std::map<std::string, int> MAP;
	std::vector<std::string> s(N);
	for (auto& r : s) {
		std::cin >> r;
		++MAP[r];
	}
	intt M; std::cin >> M;
	std::vector<std::string> t(M);
	for (auto& r : t) {
		std::cin >> r;
		--MAP[r];
	}
	int max = -201;
	for (auto& r : MAP)
		max = std::max(max, r.second);

	std::cout << std::max(max, 0) << std::endl;
}

#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  ll n;
  cin >> n;
  string s;
  map<string, int> mps;
  for(int i = 0; i < n; ++i)
  {
    cin >> s;
    mps[s]++;
  }
  ll m;
  cin >> m;
  string t;
  map<string, int> mpt;
  for(int i = 0; i < m; ++i)
  {
    cin >> t;
    mpt[t]++;
  }

  int ans = 0;
  for(const auto& m : mps)
  {
    ans = max(ans, mps[m.first] - mpt[m.first]);
  }
  cout << ans;


}

int main()
{
  fastio;
  solve();

  return 0;
}