#include <stdio.h>
#define max(p,q)((p)>(q)?(p):(q))

int h[1510];
int tate[1510],yoko[1510],cnt;

int f(int n){
	cnt=1;
	int ans=0;
	for(int i=0;i<=n;i++){
		if(h[i]>tate[cnt-1]){
			tate[cnt]=h[i];
			yoko[cnt]=i;
			cnt++;
		}
		if(h[i]<tate[cnt-1]){
			while(tate[cnt-1]>h[i]){
				ans=max(ans,tate[cnt-1]*(i-yoko[cnt-1]));
				cnt--;
			}
			tate[cnt]=h[i];
			cnt++;
		}
	}
	return ans;
}

int main(){
	int hh,w;
	scanf("%d%d",&hh,&w);
	int ans=0;
	for(int i=0;i<hh;i++){
		int t;
		for(int j=0;j<w;j++){
			scanf("%d",&t);
			h[j]++;
			if(t)h[j]=0;
		}
		int temp=f(w);
		ans=max(ans,temp);
	}
	printf("%d\n",ans);
}
