#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> vec(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long ii = 0; ii < m; ii++) {
      if (s.at(ii) == '0')
        vec.at(i).at(ii) = 0;
      else
        vec.at(i).at(ii) = 1;
    }
  }
  long long ans{0};
  for (long long i = 0; i < n; i++) {
    for (long long ii = 1; ii < m; ii++) {
      if (vec.at(i).at(ii) != 0) {
        vec.at(i).at(ii) = vec.at(i).at(ii - 1) + 1;
        if (vec.at(i).at(ii) > ans) ans = vec.at(i).at(ii);
      }
    }
  }
  for (long long i = 0; i < m; i++) {
    long long minn{0}, q{0};
    vector<long long> V(5001, 0);
    for (long long ii = 0; ii < n; ii++) {
      V.at(vec.at(ii).at(i))++;
    }
    for (long long i = 5000; i >= 0; i--) {
      q += V.at(i);
      if (ans < i * q) ans = i * q;
    }
  }
  cout << ans << endl;
}
