#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5117;
int n, m, ans, ps[MAXN][MAXN], l, r, x;
char arr[MAXN][MAXN + 1];
int main() {
  scanf("%d %d\n", &n, &m);
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) ps[i][j] = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", arr[i]);
  }
  ans = 0;
  for (int i = 0; i < n; i++) {
    for (r = 0, l = 0; l < m; l++) {
      for (r = max(l, r); r < m && arr[i][r] == '1'; r++)
        ;
      ps[l][r - l]++;
    }
  }
  for (int i = 0; i < m; i++)
    for (int j = 1; j < m; j++) ps[i][j] += ps[i][j - 1];
  for (int i = 0; i < m; i++)
    for (int j = i; j < m; j++) {
      int cur = n - ps[i][j - i];
      ans = max(cur * (j - i + 1), ans);
    }
  printf("%d\n", ans);
  return 0;
}
