#include <bits/stdc++.h>
using namespace std;
int n, m, k, h, w, ans;
int a[5005][5005], sum[5005][5005], ck[5005];
char c[5001];
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= n; i++) {
    gets(c + 1);
    for (int j = 1; j <= m; j++) {
      a[i][j] = c[j] - '0';
      if (a[i][j] == 1) sum[i][j] = sum[i][j - 1] + 1;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      ck[j] = sum[j][i];
    }
    sort(ck + 1, ck + 1 + n);
    for (int j = 1; j <= n; j++) ans = max(ans, ck[j] * (n - j + 1));
  }
  printf("%d", ans);
  return 0;
}
