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