object Main extends App {
    val scan = new java.util.Scanner(System.in)
    val n = scan.next().toInt
    val blue = for (i <- 1 to n) yield scan.next()
    val m = scan.next().toInt
    val red  = for (i <- 1 to m) yield scan.next()
    var dic = collection.mutable.Map[String, Int]()
    blue.foreach(x => if ((dic get x) == None) { dic(x) = 1  } else { dic(x) = dic(x) + 1 })
    red.foreach( x => if ((dic get x) == None) { dic(x) = -1 } else { dic(x) = dic(x) - 1 })
    println(dic.values.max)
}