#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int n, m;

struct arr{
    int w, le;
}arr[4000][4000];
int mx;
int array[4000];
int tmp[4000];
struct arr temp, tempp;

int main() {
    freopen(".10.in","r",stdin);
    freopen(".10.out","w",stdout);
    int i, j;
    int unt;
    int cnt;

    scanf("%d %d", &n, &m);
    for(i = 0; i < n; i++) {
        for(j = 0; j < m; j++) scanf("%1d", &tmp[j]);
        cnt = 0;
        for(j = 0; j < m; j++) {
            if(tmp[j] == 0) cnt = 0;
            else cnt++;
            unt = i;
            while(array[j] != 0) {
                if(arr[j][array[j] - 1].le > cnt) {
                    tempp = arr[j][array[j] - 1];
                    if((i - tempp.w) * tempp.le > mx) {
                        mx = (i - tempp.w) * tempp.le;
                    }
                    unt = arr[j][array[j] - 1].w;
                    array[j]--;
                }
                else break;
            }
            temp.w = unt;
            temp.le = cnt;
            arr[j][array[j]++] = temp;
        }
    }
    for(j = 0; j < m; j++) {
        while(array[j] != 0) {
            tempp = arr[j][array[j] - 1];
            if((n - tempp.w) * tempp.le > mx) mx = (n - tempp.w) * tempp.le;
            array[j]--;
        }
    }

    printf("%d", mx);

    return 0;
}
