#include <bits/stdc++.h>
using namespace std;
void scan(int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
const int M = 5005;
int n, m, dp[M][M];
;
int ct[M];
char s[M][M];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (j == 0)
        dp[i][j] = s[i][j] - '0';
      else
        dp[i][j] = (dp[i][j - 1] + 1) * (s[i][j] == '1');
    }
  }
  int ans = 0;
  for (int j = 0; j < m; j++) {
    memset(ct, 0, sizeof ct);
    for (int i = 0; i < n; i++) {
      ct[dp[i][j]]++;
    }
    int aft = 0;
    for (int i = m; i >= 0; i--) {
      if (ct[i] > 0) {
        aft += ct[i];
        ans = max(ans, i * aft);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
