#include <bits/stdc++.h>
using namespace std;
int ones[5005][5005], freq[5005];
int calc_maxm(int r, int c) {
  int i, j, k, s, res;
  res = 0;
  for (i = 1; i <= c; i++) {
    memset(freq, 0, sizeof(freq));
    for (j = 1; j <= r; j++) freq[ones[j][i]]++;
    s = 0;
    for (k = c; k > 0; k--) {
      s += freq[k];
      res = max(res, s * k);
    }
  }
  return res;
}
int main() {
  int n, m, i, j, ans;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i < n; i++) ones[i][0] = 0;
    for (i = 0; i < n; i++) {
      char str[5005];
      scanf("%s", str);
      for (j = 0; j < m; j++) {
        if (str[j] == 49)
          ones[i + 1][j + 1] = ones[i + 1][j] + 1;
        else
          ones[i + 1][j + 1] = 0;
      }
    }
    ans = calc_maxm(n, m);
    printf("%d\n", ans);
  }
  return 0;
}
