#include <bits/stdc++.h>
using namespace std;
char s[5005];
int f[5005][5005], w[5005];
int calc(int a[], int n) {
  int i, ans = 0;
  sort(a + 1, a + n + 1);
  for (i = n; i >= 1; i--) ans = max(ans, (n - i + 1) * a[i]);
  return ans;
}
int main() {
  int i, j, n, m, ans;
  while (scanf("%d%d", &n, &m) != EOF) {
    ans = 0;
    for (i = 1; i <= n; i++) {
      scanf("%s", s);
      f[i][0] = 0;
      for (j = 1; j <= m; j++) {
        if (s[j - 1] == '0')
          f[i][j] = 0;
        else
          f[i][j] = f[i][j - 1] + 1;
      }
    }
    for (j = 1; j <= m; j++) {
      for (i = 1; i <= n; i++) w[i] = f[i][j];
      ans = max(ans, calc(w, n));
    }
    printf("%d\n", ans);
  }
  return 0;
}
