fun main(args : Array<String>) { 
  val b = (0 until readLine()!!.toInt()).map { readLine() }
  val r = (0 until readLine()!!.toInt()).map { readLine() }
  b.map { s -> (b.count { s == it } - r.count { s == it }) }.plus(0).let { print(it.max()) }
}