object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val Ss, Ts = List.fill(sc.nextInt())(sc.next()).groupBy(identity).view.mapValues(_.length)
  println(Ss.map{ case (s, count) => (count - Ts.getOrElse(s, 0)).max(0) }.max)
}
