#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int> > V2;
vector<long long int> ind[5002];
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int XpowerY(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  x = x % m;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % m;
    x = ((x % m) * (x % m)) % m;
    y = y >> 1;
  }
  return ans % m;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int start, n, m, x, ans = 0, X;
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    X = 0;
    start = 1;
    for (long long int j = 0; j < m; j++) {
      if (s[j] - '0' == 0) {
        if (X != 0) {
          V2.push_back(make_pair(start, X));
        }
        start = j + 2;
        X = 0;
      } else {
        X++;
      }
    }
    if (X != 0) {
      V2.push_back(make_pair(start, X));
    }
  }
  for (long long int i = 0; i < V2.size(); i++) {
    long long int beg = V2[i].first, len = V2[i].second, it = 1;
    for (long long int j = beg; it <= len; j++) {
      ind[j].push_back(len - it + 1);
      it++;
    }
  }
  for (long long int i = 1; i <= m; i++) {
    long long int sz = ind[i].size();
    sort(ind[i].begin(), ind[i].end());
    for (long long int j = 0; j < ind[i].size(); j++) {
      ans = max(ans, ind[i][j] * (sz - j));
    }
  }
  cout << ans;
  return 0;
}
