#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > cuenta(m, vector<int>(n));
  for (int i = 0; i < n; i++) {
    string numstr;
    cin >> numstr;
    for (int j = m - 1; j >= 0; j--) {
      int num = static_cast<int>(numstr[j] - '0');
      if (j == m - 1) {
        cuenta[j][i] = num;
      } else {
        cuenta[j][i] = (cuenta[j + 1][i] + 1) * num;
      }
    }
  }
  vector<int> B(n);
  vector<int> C(m + 1);
  for (int j = 0; j < m; j++) {
    for (int i = 0; i <= m; i++) {
      C[i] = 0;
    }
    for (int i = 0; i < n; i++) {
      C[cuenta[j][i]]++;
    }
    for (int i = 1; i <= m; i++) {
      C[i] += C[i - 1];
    }
    for (int i = n - 1; i >= 0; i--) {
      B[C[cuenta[j][i]] - 1] = cuenta[j][i];
      C[cuenta[j][i]]--;
    }
    for (int i = 0; i < n; i++) {
      cuenta[j][i] = B[i];
    }
  }
  int area = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      area = max(area, cuenta[j][i] * (n - i));
    }
  }
  cout << area << endl;
  return 0;
}
