print((function ()
	local h = {}
	for i=1,tonumber(io.stdin:read("*l")) do
		local s = io.stdin:read("*l")
		if h[s] ~= nil then h[s] = h[s]+1 else h[s] = 1 end
	end
	for i=1,tonumber(io.stdin:read("*l")) do
		local s = io.stdin:read("*l")
		if h[s] ~= nil then h[s] = h[s]-1 else h[s] = -1 end
	end

	local r = 0
	for _,v in pairs(h) do if v > r then r = v end end
	return r
end)())