#include <bits/stdc++.h>
using namespace std;
const int nm = 5002;
int n, m;
char a[nm][nm];
int l[nm][nm];
int dem[nm];
void nhap() {
  scanf("%d%d", &m, &n);
  int i, j;
  for (i = 1; i <= m; ++i) scanf("%s", a[i]);
}
inline void sx(int j) {
  int i;
  memset(dem, 0, sizeof(dem));
  for (i = 1; i <= m; ++i) dem[l[i][j]]++;
  int u = 1;
  i = 0;
  while (i <= n && u <= m) {
    while (dem[i]) {
      l[u][j] = i;
      u++;
      dem[i]--;
    }
    while (i <= n && !dem[i]) ++i;
  }
}
void xuli() {
  int i, j;
  for (i = 1; i <= m; ++i) {
    for (j = 1; j <= n; ++j) {
      if (a[i][j - 1] == '1')
        l[i][j] = l[i][j - 1] + 1;
      else
        l[i][j] = 0;
    }
  }
  for (j = 1; j <= n; ++j) sx(j);
  int kq = 0;
  for (i = 1; i <= m; ++i) {
    for (j = 1; j <= n; ++j)
      if (l[i][j] * (m - i + 1) > kq) kq = l[i][j] * (m - i + 1);
  }
  printf("%d", kq);
}
int main() {
  nhap();
  xuli();
}
