import io.StdIn.{readInt, readLine}
object Main extends App {
  val n = readInt
  val ss = for (_ <- 1 to n) yield readLine
  val m = readInt
  val ts = for (_ <- 1 to m) yield readLine

  val cards = (ss ++: ts).distinct
  val counts = cards.map(card => ss.count(_ == card) - ts.count(_ == card))
  println(math.max(0, counts.max))

}