fun main(args:Array<String>) {
    val blueCardCount = readLine()!!.toInt()
    val blueCards = (1..blueCardCount).map { readLine()!! }
    val redCardCount = readLine()!!.toInt()
    val redCards = (1..redCardCount).map { readLine()!! }
    val count = blueCards.union(redCards).map { word-> Pair(word, blueCards.count { it == word } - redCards.count { it == word }) }.toMap()
    val ans = Math.max(count.maxBy { it.value }!!.value, 0)
    println(ans)
}
