fun main(args: Array<String>) {
    abc091b()
}

fun abc091b() {
    val n = readLine()!!.toInt()
    val sList = (1..n).map { readLine()!! }
    val m = readLine()!!.toInt()
    val tList = (1..m).map { readLine()!! }

    val counts = sList.map { s ->
        sList.count { s == it } - tList.count { s == it }
    }

    val answer = Math.max(counts.max()!!, 0)

    println(answer)
}
