#include <bits/stdc++.h>
using namespace std;
int ans[5001][5001];
int main() {
  memset((ans), 0, sizeof(ans));
  int n, m, l, r;
  char s[5001];
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    l = r = 0;
    scanf("%s", s);
    for (int j = 0; j < m; j++) {
      if (s[j] == '0') {
        l = j + 1;
      } else
        ans[l][j]++;
    }
  }
  int maxi = -1, x, y;
  for (int i = 2; i < m; i++) {
    for (int j = 1; j <= i; j++) {
      ans[j][i] += ans[j - 1][i];
    }
  }
  for (int i = 0; i <= m; i++)
    for (int j = i; j < m; j++) maxi = max((j - i + 1) * ans[i][j], maxi);
  cout << maxi << endl;
  return 0;
}
