import java.util.Scanner
import scala.collection.mutable.Stack 

object Main extends App { 
  val sc = new Scanner(System.in)
  val H, W = sc.nextInt()
  val map = Array.ofDim[Int](H,W)
  for (i <- 0 until H; j <- 0 until W) map(i)(j) = sc.nextInt()

  val bar = Array.fill[Int](W)(0)
  val hist = new Histgram()

  class Histgram() {
    var stack = Stack[Int]()

    @scala.annotation.tailrec
    final def solver(i:Int, m:Int):Int = {
      def compute(i:Int, m:Int):Int = {
        if (stack.isEmpty || i < W && bar(stack.top) <= bar(i)) m
        else {
          val t = stack.pop
          val n = bar(t) * (if (stack.isEmpty) i else (i -stack.top -1))

          compute(i, n max m)
        }
      }

      if (i == W) compute(i, m)
      else if (stack.isEmpty || bar(stack.top) <= bar(i)) {
        stack.push(i)
        solver(i+1, m)
      }
      else solver(i, compute(i, m))

    }
  }

  def solver(h:Int, m:Int):Int = {
    if (h < H) {
      map(h).indices.foreach(i => bar(i) = if (map(h)(i) == 0) bar(i)+1 else 0)
      val n = hist.solver(0, 0)
      solver(h+1, m max n)
    } else m
  }

  println(solver(0, 0))

}
