#include <bits/stdc++.h>
int a[5000][5000], n, m, i, j, c, k, p;
bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      c = getchar();
      while (c != 48 && c != 49) c = getchar();
      if (c == 49) {
        a[j][i] = 1;
        if (j) a[j][i] += a[j - 1][i];
        if (a[j][i] > k) k = a[j][i];
      }
    }
  for (j = 0; j < m; j++) std::sort(a[j], a[j] + n, cmp);
  for (j = m - 1; j >= 0; j--) {
    p = a[j][0];
    for (i = 1; i < n && p; i++) {
      if (a[j][i] < p) p = a[j][i];
      if ((p = p * (i + 1)) > k) k = p;
    }
  }
  printf("%d\n", k);
  return 0;
}
