object Main extends App {
	val n = scala.io.StdIn.readInt
	var temp1 = scala.io.StdIn.readLine
	var s = Map(temp1 -> 1)
	for(i<-1 until n){
		temp1 = scala.io.StdIn.readLine
		s.get(temp1) match {
			case None => s = s ++ Map(temp1 -> 1)
			case Some(x) => s = s++ Map(temp1 -> (x+1))
		}
	}

	val m = scala.io.StdIn.readInt
	var temp2 = scala.io.StdIn.readLine
	var t = Map(temp2 -> 1)
	for(i<-1 until m){
		temp2 = scala.io.StdIn.readLine
		t.get(temp2) match {
			case None => t = t ++ Map(temp2 -> 1)
			case Some(x) => t = t++ Map(temp2 -> (x+1))
		}
	}

	var key = (s.keySet ++ t.keySet).map(x => (test(s.get(x)) - test(t.get(x))))
	
	def test(x: Option[Int]): Int = {
		x match {
			case None => 0
			case Some(t) => t
		}
	}

	
	if(key.max < 0){
		println(0)
	}else{
		println(key.max)
	}

}