#include <bits/stdc++.h>
using namespace std;
int getMaxArea(int hist[], int n) {
  stack<int> s;
  int max_area = 0;
  int tp;
  int area_with_top;
  int i = 0;
  while (i < n) {
    if (s.empty() || hist[s.top()] <= hist[i])
      s.push(i++);
    else {
      tp = s.top();
      s.pop();
      area_with_top = hist[tp] * (s.empty() ? i : i - s.top() - 1);
      if (max_area < area_with_top) max_area = area_with_top;
    }
  }
  while (s.empty() == false) {
    tp = s.top();
    s.pop();
    area_with_top = hist[tp] * (s.empty() ? i : i - s.top() - 1);
    if (max_area < area_with_top) max_area = area_with_top;
  }
  return max_area;
}
int d[5010][5010];
int main() {
  int n, m;
  scanf("%d", &n);
  ;
  scanf("%d", &m);
  ;
  char s[5010];
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = m - 1; j >= 0; j--) {
      if (s[j] == '1')
        d[i][j] = 1 + d[i][j + 1];
      else
        d[i][j] = 0;
    }
  }
  int ans = 0, hist[5010];
  for (int i = 0; i < m; i++) {
    int h[5010] = {}, in = 0;
    for (int j = 0; j < n; j++) h[d[j][i]]++;
    for (int j = 0; j < (m + 2); j++)
      while (h[j]) {
        hist[in++] = j;
        h[j]--;
      }
    ans = max(ans, getMaxArea(hist, n));
  }
  printf("%d\n", ans);
  return 0;
}
