
object Main extends App {

  import scala.io.StdIn._
  val Array(m, n) = readLine.trim.split(' ').map(_.toInt)
  val scores = Array.tabulate(m){_ ⇒ readLine.trim.split(' ').map(_.toInt).count(_ == 1)}
  println(scores.max)
}

