#include <bits/stdc++.h>
using namespace std;
int dyn[5007][5007];
char mp[5007];
int main() {
  memset((dyn), (0), sizeof((dyn)));
  int R, C;
  scanf("%d %d ", &R, &C);
  for (int r = (0); r < (R); r++) {
    gets(mp);
    int cnt = 0;
    for (int c = (C - 1); c >= (0); c--) {
      if (mp[c] == '1')
        cnt++;
      else
        cnt = 0;
      dyn[c][c + cnt]++;
    }
  }
  int mx = 0;
  for (int c = (0); c < (C); c++) {
    int cnt = 0;
    for (int e = (C); e >= (c); e--) {
      cnt += dyn[c][e];
      mx = max(mx, cnt * (e - c));
    }
  }
  cout << mx << endl;
  return 0;
}
