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 <bits/stdc++.h>
using namespace std;

#define H 1401
#define W 1401

int A[H+1][W+1];
int Hist[H+1][W+1];

struct Rectangle {
    int height;
    int pos;
};

int getLargestRectangle(int h, int w) {
    for (int i = 0; i < h+1; i++) Hist[i][0] = 0;
    for (int j = 0; j < w+1; j++) Hist[0][j] = 0;

    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (A[i][j] == 1) {
                Hist[i][j] = 0;
            } else {
                Hist[i][j] = Hist[i-1][j] + 1;
            }
        }
    }

    int largest = 0;
    stack<Rectangle> S;
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (S.empty()) {
                S.push({Hist[i][j], j});
            } else if (S.top().height < Hist[i][j]) {
                S.push({Hist[i][j], j});
            } else if (S.top().height > Hist[i][j]) {
                int lastPos;
                while (!S.empty() && S.top().height > Hist[i][j]) {
                    Rectangle rect = S.top();
                    S.pop();
                    if (largest < rect.height * (j - rect.pos)) {
                        largest = rect.height * (j - rect.pos);
                    } 
                    lastPos = rect.pos;
                }
                S.push({Hist[i][j], lastPos});
            }
        }
        
        if (!S.empty()) {
            while (!S.empty()) {
                Rectangle rect = S.top();
                S.pop();
                if (largest < rect.height * (w - rect.pos + 1)) {
                    largest = rect.height * (w - rect.pos + 1);
                } 
            }
        }
    }

    return largest;
}

int main() {
    int h, w;
    cin >> h >> w;

    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            cin >> A[i][j];
        }
    }

    for (int i = 0; i < h+1; i++) A[i][0] = 0;
    for (int j = 0; j < w+1; j++) A[0][j] = 0;

    cout << getLargestRectangle(h, w) << endl;

    return 0;
}

