#include <bits/stdc++.h>
using namespace std;
char s[5010][5010];
int r[5010][5010];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++) {
    int tmp = 0;
    for (int j = m; j >= 1; j--) {
      if (s[i][j] == '0')
        tmp = 0;
      else
        tmp++;
      r[j][i] = tmp;
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    sort(r[i] + 1, r[i] + n + 1);
    for (int j = 1; j <= n; j++) ans = max(ans, r[i][j] * (n - j + 1));
  }
  printf("%d", ans);
  return 0;
}
