
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n = Array.fill(sc.nextInt())(sc.next()).groupMapReduce(identity)(_ => 1)(_ + _)
  val m = Array.fill(sc.nextInt())(sc.next()).groupMapReduce(identity)(_ => 1)(_ + _)
  val ans = n.keys.map(key => n.getOrElse(key, 0) - m.getOrElse(key, 0)).max
  println(if (ans < 0) 0 else ans)
}
