object Main extends App{
import scala.collection.mutable
import scala.io.StdIn._

val map = mutable.Map.empty[String, Int]
val n = readInt()

Iterator.continually(readLine)
    .take(n)
    .foreach(s => {
      if (map.contains(s)) map.put(s, map(s)+1) else map += s->1
    })

val m = readInt()
Iterator.continually(readLine)
    .take(m)
    .foreach(s => {
      if (map.contains(s)) map.put(s, map(s)-1)
    })

println(List(0,map.values.max).max)
}