fun main(args: Array<String>) {
    val N: Int = readLine()!!.toInt()
    val s = Array<String>(N, { readLine()!! })
    val M: Int = readLine()!!.toInt()
    val t = Array<String>(M, { readLine()!! })
    val alls = s.toSet() + t.toSet()
    var max = 0
    for (word in alls) {
        val now = s.count { it == word } - t.count { it == word }
        max = if (now > max) now else max
    }
    println(max)
}
