import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = (1..n).map { sc.next() }
  val m = sc.nextInt()
  val t = (1..m).map { sc.next() }

  println(abc091b(n, s, m, t))
}

private fun abc091b(n: Int, s: List<String>, m: Int, t: List<String>): Int {
  val map = mutableMapOf<String, Int>()
  for (si in s) {
    if (map.containsKey(si)) {
      val c = map.get(si)!! + 1
      map.put(si, c)
    } else {
      map.put(si, 1)
    }
  }
  for (ti in t) {
    if (map.containsKey(ti)) {
      val c = map.get(ti)!! - 1
      map.put(ti, c)
    }
  }

  val ans = map.values.max()!!
  if (ans <= 0) return 0

  return ans
}
