fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val map = mutableMapOf<String, Int>()
    for (i in 0 until sc.next().toInt()){
        val s = sc.next()
        if (map[s] == null) map[s] = 1
        else map[s] = map[s]!! + 1
    }
    for (i in 0 until sc.next().toInt()){
        val t = sc.next()
        if (map[t] == null) map[t] = 0
        else map[t] = map[t]!! - 1
    }
    println(if (map.values.max()!! < 0) 0 else map.values.max())
}