#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > mat(n, vector<int>(m));
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)m; j++) {
      char c;
      cin >> c;
      mat[i][j] = c - '0';
    }
  vector<vector<int> > r(n, vector<int>(m, m));
  for (int i = 0; i < (int)n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (j < m - 1) r[i][j] = r[i][j + 1];
      if (!mat[i][j]) r[i][j] = j;
    }
  }
  int ans = 0;
  for (int l = 0; l < (int)m; l++) {
    vector<int> stp(m);
    int ct = 0;
    for (int i = 0; i < (int)n; i++) {
      if (!mat[i][l]) continue;
      ct++;
      if (r[i][l] != m) stp[r[i][l]]++;
    }
    for (int r = l; r < (int)m; r++) {
      ct -= stp[r];
      ans = max(ans, (r - l + 1) * ct);
    }
  }
  cout << ans << '\n';
}
