#include <bits/stdc++.h>
using namespace std;
char s[5010];
int p[5010];
vector<int> hr[5010];
int main() {
  int n, m, anw = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = 0; j < m; j++) {
      if (s[j] == '0')
        p[j] = 0;
      else
        p[j] = (j ? p[j - 1] + 1 : 1);
      hr[j].push_back(p[j]);
    }
  }
  for (int i = 0; i < m; i++) {
    sort(hr[i].begin(), hr[i].end());
    int l = 0;
    for (int h : hr[i]) anw = max(anw, (n - (l++)) * h);
  }
  printf("%d\n", anw);
}
