#include <bits/stdc++.h>
using namespace std;
int m, n, a[5006], c[5006];
char p[5006][5006];
int main() {
  int i, j, x;
  scanf("%d%d", &n, &m);
  int ans = 0;
  for (i = 1; i <= n; i++) {
    scanf("%s", p[i] + 1);
  }
  int mx = 0;
  for (i = 1; i <= m; i++) {
    mx = 0;
    memset(a, 0, sizeof(a));
    for (j = 1; j <= n; j++) {
      if (p[j][i] == '1')
        c[j]++;
      else
        c[j] = 0;
      a[c[j]]++;
      mx = max(c[j], mx);
    }
    for (j = mx; j > 0; j--) {
      ans = max(ans, a[j] * j);
      a[j - 1] += a[j];
    }
  }
  printf("%d\n", ans);
}
