

import scala.collection.mutable
import scala.io.StdIn

object Main extends App {

  val map = mutable.Map.empty[String,Int]
  val n = StdIn.readInt
  Iterator.continually(StdIn.readLine)
      .take(n)
      .foreach(s => {
        if (map.contains(s)) map.put(s, map(s) + 1) else map += s -> 1
      })

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

  val ans = map.values.max

  println(if(ans <0 ) 0 else ans)
}