ary = []
n = gets.to_i
blue = n.times.map{gets.chomp}.group_by(&:itself).map{|k,v|[k,v.count]}.to_h
m = gets.to_i
red = m.times.map{gets.chomp}.group_by(&:itself).map{|k,v|[k,v.count]}.to_h
blue.each_key{|k|red.include?(k) ? ary<<blue[k]-red[k] : ary<<blue[k]}
puts ary.size==1 && ary.first<=0 ? 0 : ary.max
