#include <bits/stdc++.h>
using namespace std;
int n, m;
char v[5010][5010];
int ac[5010][5010];
int x[5010];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf(" %s", v[i]);
  }
  for (int i = 0; i < n; i++) {
    if (v[i][m - 1] == '1')
      ac[i][m - 1] = 1;
    else
      ac[i][m - 1] = 0;
    for (int j = m - 2; j >= 0; j--) {
      if (v[i][j] == '0') {
        ac[i][j] = 0;
      } else {
        ac[i][j] = 1 + ac[i][j + 1];
      }
    }
  }
  int res = 0;
  for (int j = 0; j < m; j++) {
    memset(x, 0, sizeof(x));
    for (int i = 0; i < n; i++) {
      x[ac[i][j]]++;
    }
    int soma = n;
    for (int i = 0; i < m + 1; i++) {
      if (x[i] == 0) continue;
      res = max(res, i * soma);
      soma -= x[i];
    }
  }
  printf("%d\n", res);
  return 0;
}
