object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val n = sc.nextInt()
    val sList = List.fill(n)(sc.next())
    val m = sc.nextInt()
    val tList = List.fill(m)(sc.next())

    val sGrouped = sList.groupBy(s => s).mapValues(_.size).toList
    val tGrouped = tList.groupBy(s => s).mapValues(-_.size).toList

    val list = (sGrouped ::: tGrouped).groupBy(s => s._1).mapValues(s => s.map(_._2).sum).toList
    val max = list.maxBy(l => l._2)

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