#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5007;
const int MAX_M = 5007;
char c[MAX_N][MAX_M];
int d[MAX_N][MAX_N];
int nxt[MAX_N];
int n, m;
int calc() {
  int ret = 0;
  memset(d, 0, sizeof(d));
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = m - 1; j >= 0; j--) {
      if (c[i][j] == '1')
        cnt++;
      else
        cnt = 0;
      d[j][cnt]++;
    }
  }
  for (int i = 0; i < m; i++) {
    int cnt = 0;
    for (int j = m; j > 0; j--) {
      cnt += d[i][j];
      ret = max(ret, cnt * j);
    }
  }
  return ret;
}
int calcb() {
  for (int i = 0; i < n; i++) {
    nxt[i] = -1;
    c[i][m] = '0';
  }
  int res = 0;
  for (int j = 0; j < m; j++) {
    vector<int> lns;
    for (int i = 0; i < n; i++) {
      if (nxt[i] < j) {
        nxt[i] = j;
        while (c[i][nxt[i]] == '1') nxt[i]++;
      }
      lns.push_back(nxt[i] - j);
    }
    sort(lns.begin(), lns.end());
    for (int k = 0; k < n; k++) {
      int v = (n - k) * lns[k];
      res = max(v, res);
    }
  }
  return res;
}
int cal() {
  int size = sizeof(c);
  memset(d, 0, size);
  int pl = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int p = j;
      while (c[i][p] == '1' && p < m) {
        int dl = p - j;
        d[j][p - j] += dl;
        pl = max(pl, d[j][p - j]);
        p++;
      }
      int dl = p - j;
      d[j][p - j] += dl;
      pl = max(pl, d[j][p - j]);
    }
  }
  return pl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> c[i];
  cout << calc() << "\n";
}
