object Main extends App {
  val n = readInt
  val s = (1 to n).map{_ => readLine}
  val m = readInt
  val t = (1 to m).map{_ => readLine}
  
  var map = Map.empty[String,Int]
  
  (0 until n).foreach{i =>
    map = map.updated(s(i),map.getOrElse(s(i),0)+1)
  }
  
  (0 until m).foreach{i =>
    map = map.updated(t(i),map.getOrElse(t(i),0)-1)
  }
  
  println(Array(map.values.max,0).max)
}