#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
bool maxi(A &a, const B &b) {
  return (a < b) ? (a = b, true) : false;
};
template <class A, class B>
bool mini(A &a, const B &b) {
  return (a > b) ? (a = b, true) : false;
};
const int maxN = 5005, maxM = 5005, inf = 1e9;
int n, m, res, r[maxN][maxM], v[maxN];
char matrix[maxN][maxM];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = (1), _b = (n); i <= _b; ++i) {
    cin >> matrix[i] + 1;
    for (int j = (m), _b = (1); j >= _b; --j)
      if (matrix[i][j] == '1') r[i][j] = r[i][j + 1] + 1;
  }
  function<void(const int)> countingSort = [&](const int j) {
    vector<int> cnt(m + 5, 0);
    for (int i = (1), _b = (n); i <= _b; ++i) ++cnt[r[i][j]];
    int x = 0;
    for (int i = (m), _b = (0); i >= _b; --i)
      for (int j = (1), _b = (cnt[i]); j <= _b; ++j) v[++x] = i;
  };
  for (int j = (1), _b = (m); j <= _b; ++j) {
    countingSort(j);
    for (int i = (1), _b = (n); i <= _b; ++i) maxi(res, i * v[i]);
  }
  cout << res << '\n';
  return 0;
}
