#include <bits/stdc++.h>
using namespace std;
char ch[5005][5005];
int pre[5005][5005];
int one[5005], cnt[5005];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", ch[i]);
    pre[i][m] = 0;
    for (int j = m - 1; j >= 0; --j) {
      if (ch[i][j] == '0')
        pre[i][j] = 0;
      else
        pre[i][j] = pre[i][j + 1] + 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) one[j] = pre[j][i];
    for (int j = 0; j <= m; ++j) cnt[j] = 0;
    for (int j = 0; j < n; ++j) cnt[one[j]]++;
    int count = 0;
    for (int j = 0; j <= m; ++j)
      for (int k = 0; k < cnt[j]; ++k) one[count++] = j;
    for (int j = 0; j < n; ++j) {
      ans = max(ans, one[j] * (n - j));
    }
  }
  cout << ans << endl;
  return 0;
}
