local read = io.read

local N = read("*n", "*l")
local card_point_s = {}
for i = 1, N do
	local str = read("*l")
	if card_point_s[str] then
		card_point_s[str] = card_point_s[str] + 1
	else
		card_point_s[str] = 1
	end
end

local M = read("*n", "*l")
for i = 1, M do
	local str = read("*l")
	if card_point_s[str] then
		card_point_s[str] = card_point_s[str] - 1
	else
		card_point_s[str] = -1
	end
end


local max_point = 0
for key, value in pairs(card_point_s) do
	if value >= max_point then
		max_point = value
	end
end

print(max_point)
