fun main(args: Array<String>) {
    val b = Array(readLine()!!.toInt()) { readLine()!! }.groupBy { it }
    val r = Array(readLine()!!.toInt()) { readLine()!! }.groupBy { it }

    var max = 0
    for (i in b) {
        max = Math.max(i.value.size - r.getOrElse(i.key) { listOf() }.size, max)
    }
    println(max)
}

