import java.util.*

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

    val N = scanner.nextInt()
    for (i in 1..N) {
        val str = scanner.next()
        map[str] = map.getOrElse(str, {0}) + 1
    }

    val M = scanner.nextInt()
    for (i in 1..M) {
        val str = scanner.next()
        map[str] = map.getOrElse(str, {0}) - 1
    }

    val result = map.toList().sortedBy { it -> it.second }.last().second
    if (result > 0) println(result)
    else println(0)
}