import java.io.FileInputStream
import java.util.*


var sc: Scanner = Scanner(System.`in`)
fun main(args: Array<String>) {
    if (args.size > 0) {
        System.setIn(FileInputStream(args[0]))
    }
    sc = Scanner(System.`in`)

    problem()

}

fun problem() {

    val N = sc.nextInt()
    sc.nextLine()
    val brueCards = mutableMapOf<String, Int>()
    for (a in 1..N) {
        val key = sc.nextLine()
        if (brueCards[key] == null) {
            brueCards[key] = 1
        }
        else {
            brueCards[key] = brueCards[key]!! + 1
        }
    }

    val M = sc.nextInt()
    sc.nextLine()
    for (a in 1..M) {
        val key = sc.nextLine()
        if (brueCards[key] == null) {
            brueCards[key] = -1
        }
        else {
            brueCards[key] = brueCards[key]!! - 1
        }
    }

    var maxk: String? = null
    var maxv = -200
    for ((key, value) in brueCards) {
        if (value == null) {
            return
        }
        if (value > maxv) {
            maxv = value
            maxk = key
        }
    }
    if (maxv >= 0) {
        println(maxv)
    }
    else {
        println(0)
    }

    //println(redCards)


    //var ans = sortedList.joinToString("")
    //println(Q)
}
