import scala.io.StdIn._
import scala.math.max

object Main extends App {
  val n = readInt()
  val s = (0 until n).map(_ => readLine())
  val m = readInt()
  val t = (0 until m).map(_ => readLine())

  val nmap = s.groupBy(e => e)
  val mmap = t.groupBy(e => e)

  println(max(0, nmap.map(e => e._2.length - mmap.get(e._1).map(a => a.length).getOrElse(0)).max))
}
