#include <bits/stdc++.h>
using namespace std;
int dp[5002][5002];
char a[5002][5002];
int main() {
  int n, m, i, j;
  scanf("%d", &n);
  ;
  scanf("%d", &m);
  ;
  for (i = 0; i < n; i++) scanf("%s", a[i]);
  for (i = 0; i < n; i++) {
    int prev = 0, k;
    j = 0;
    while (j < m) {
      while (j < m && a[i][j] == '1') j++;
      for (k = prev; k <= j; k++) dp[i][k] = j - k;
      prev = j + 1;
      j++;
    }
  }
  int area = 0;
  for (i = 0; i < m; i++) {
    int freq[5003] = {0}, cum[5003] = {0};
    for (j = 0; j < n; j++) {
      freq[dp[j][i]]++;
    }
    cum[m] = freq[m];
    for (j = m - 1; j >= 0; j--) cum[j] = cum[j + 1] + freq[j];
    for (j = 0; j <= m; j++) area = max((cum[j] * j), area);
  }
  printf("%d\n", area);
  return 0;
}
