Given a matrix (H × W) which contains only 1 and 0, find the area of the largest rectangle which only contains 0s.

Constraints

* 1 ≤ H, W ≤ 1,400

Input


H W
c1,1 c1,2 ... c1,W
c2,1 c2,2 ... c2,W
:
cH,1 cH,2 ... cH,W


In the first line, two integers H and W separated by a space character are given. In the following H lines, ci,j, elements of the H × W matrix, are given.

Output

Print the area (the number of 0s) of the largest rectangle.

Example

Input

4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 1 0
0 0 0 1 0


Output

6
#include <array>
#include <cstddef>
#include <iostream>
#include <stack>

int H, W;
const int HMAX = 1500;
const int WMAX = 1500;

int c[HMAX][WMAX];
int hist[HMAX][WMAX];
int dp[HMAX][WMAX];

struct Rectangle
{
    int height, pos;
};

int main()
{
    std::cin >> H >> W;

    for (size_t i = 1; i <= H; ++i)
    {
        for (size_t j = 1; j <= W; ++j)
        {
            std::cin >> c[i][j];
        }
    }

    // make histogram
    for (size_t j = 1; j <= W; ++j)
    {
        hist[0][j] = 0;
    }
    for (size_t j = 1; j <= W; ++j)
    {
        for (size_t i = 1; i <= H; ++i)
        {
            if (c[i][j] == 1)
            {
                hist[i][j] = 0;
            }
            else
            {
                hist[i][j] = hist[i - 1][j] + 1;
            }
        }
    }
    for (size_t i = 1; i <= H; ++i)
    {
        c[i][W + 1] = 0;
    }

    // for (size_t i = 1; i <= H; ++i)
    // {
    //     for (size_t j = 1; j <= W; ++j)
    //     {
    //         std::cout << hist[i][j] << " ";
    //     }
    //     std::cout << std::endl;
    // }

    int largest = 0;

    for (size_t i = 1; i <= H; ++i)
    {
        std::stack<Rectangle> s;
        for (int j = 1; j <= W+1; ++j)
        {
            if (s.empty() || hist[i][j] > s.top().height)
            {
                s.push(Rectangle{hist[i][j], j});
            }
            else if (hist[i][j] < s.top().height)
            {
                Rectangle rect;
                while (!s.empty() && s.top().height >= hist[i][j])
                {
                    rect = s.top();
                    s.pop();
                    int area = (j - rect.pos) * rect.height;
                    if (area > largest)
                    {
                        largest = area;
                    }
                }

                s.push(Rectangle{hist[i][j], rect.pos});
            }
        }
    }

    std::cout << largest << std::endl;
}

