import java.util.*

fun main(args: Array<String>) {
    val dic = mutableMapOf<String, Int>()
    val sc = Scanner(System.`in`)

    val n = sc.nextInt()
    repeat(n) {
        val s = sc.next()
        dic[s] = (dic[s] ?: 0) + 1
    }

    val m = sc.nextInt()
    repeat(m) {
        val t = sc.next()
        dic[t] = (dic[t] ?: 0) - 1
    }

    println(Math.max(0, dic.values.max() ?: 0))
}
