#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, f, g, h, i, j, k;
char w[5005][5005];
int H[5005];
vector<pair<int, int> > G;
int an;
int main() {
  cin >> a >> b;
  for (i = 1; i <= a; i++) scanf("%s", w[i] + 1);
  for (i = 1; i <= a; i++) {
    pair<int, int> tmp;
    for (j = 1; j <= b; j++)
      if (w[i][j] == '1') {
        if (j == 1 || w[i][j - 1] != '1') tmp.first = j;
        if (j == b || w[i][j + 1] != '1') {
          tmp.second = j;
          G.push_back(tmp);
        }
      }
  }
  sort(G.begin(), G.end());
  int now = 0;
  for (i = 1; i <= b; i++) {
    while (now < G.size() && G[now].first <= i) {
      H[G[now].second]++;
      now++;
    }
    int sigma = 0;
    for (j = b; j >= i; j--) {
      sigma += H[j];
      an = max(an, (j - i + 1) * sigma);
    }
  }
  cout << an << endl;
  return 0;
}
