#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char p[5100][5100];
int b[5100], top, s[5100];
int ans;
bool cmp(int x, int y) { return x > y; }
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; ++i) scanf("%s", p[i] + 1);
  for (i = 1; i <= m; ++i) {
    for (j = 1; j <= n; ++j)
      if (s[j] < i) {
        s[j] = i;
        while (p[j][s[j]] == '1') ++s[j];
      }
    memcpy(b, s, sizeof(s));
    sort(b + 1, b + n + 1, cmp);
    for (j = 1; j <= n; ++j)
      if (ans < j * (b[j] - i)) ans = j * (b[j] - i);
  }
  printf("%d\n", ans);
  return 0;
}
