#include <bits/stdc++.h>
using namespace std;
int n, m, w[5555][5555], res, p[5555];
char c[5555][5555];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", c[i]);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (c[j][i] == '0')
        w[j][i] = 0;
      else
        w[j][i] = w[j][i - 1] + 1;
    }
    for (int j = 0; j < n; j++) p[w[j][i]]++;
    int k = 0;
    for (int j = m; j >= 1; j--) {
      k += p[j];
      p[j] = 0;
      res = max(res, k * j);
    }
  }
  cout << res;
  return 0;
}
