fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    val blueCards = (1..n).map { readLine()!! }
    val m = readLine()!!.toInt()
    val redCards = (1..m).map { readLine()!! }
    val ans = Math.max(blueCards.union(redCards).map { w->blueCards.count { it == w } - redCards.count { it == w } }.max()!!, 0)
    println(ans)
}
