#include<iostream> #include<cstdio> #include<cstring> #include<cstring> #include<algorithm> #define MAXN (5000 + 5) #define rint register int #define cint const int usingnamespace std; int n, m, a[MAXN][MAXN], ans, sora[MAXN], sorf[MAXN][MAXN], ton[MAXN]; inlineintmax(cint x, cint y){ return (x > y) ? x : y; } voidmsort(cint x){ for (rint i = 1; i <= n; ++i) ++ton[sorf[i][x]]; int tot = 0; for (rint i = m; i >= 0; --i) if (ton[i]){ tot += ton[i]; ans = max(ans, i * tot); ton[i] = 0; if (tot == n) return ; } } voidsolve(){ for (rint i = 1; i <= m; ++i) msort(i); printf("%d", ans); } intread(){ rint re = 0; registerchar x = 0; while (x < '0' || x > '9') x = getchar(); while (x <= '9' && x >= '0') re = (re << 1) + (re << 3) + x - '0', x = getchar(); return re; } intread01(){ registerchar x = 0; while (x != '0' && x != '1') x = getchar(); return x - '0'; } intmain(){ n = read(), m = read(); for (rint i = 1; i <= n; ++i) for (rint j = 1; j <= m; ++j) a[i][j] = read01(); for (rint i = 1; i <= n; ++i) for (rint j = m, last = 0; j >= 1; --j) if (!a[i][j]) last = 0; else { if (!last) last = j; sorf[i][j] = last - j + 1; } solve(); return0; }