fun main(args: Array<String>) {
    val n= readLine()!!.toInt()
    val s= (1..n).map { readLine()!! }
    val m= readLine()!!.toInt()
    val t= (1..m).map { readLine()!! }

    val z=s.distinct().map { str -> s.count{it==str} - t.count{it==str} } + 0
    println(z.max())

}