object Main extends App {
  val s = new java.util.Scanner(System.in)
  def f = { val n = s.nextInt; Iterator.continually(s.next).take(n) }
  val a = f.foldLeft(Map.empty[String, Int].withDefaultValue(0))((l, r) => l.updated(r, 1 + l(r)))
  val b = f.foldLeft(a)((l, r) => l.updated(r, l(r) - 1))
  val x = b.values.max
  println(if (x < 0) 0 else x)
}