#include <bits/stdc++.h>
using namespace std;
int mdp[5001][5001];
string a[5001];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (a[i - 1][j - 1] == '1') {
        mdp[i][j] = mdp[i][j - 1] + 1;
      } else {
        mdp[i][j] = 0;
      }
    }
  vector<vector<int>> vi(m + 1);
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) vi[j].push_back(mdp[i][j]);
  for (int i = 1; i < vi.size(); i++) sort(vi[i].rbegin(), vi[i].rend());
  int64_t max_ = 0;
  for (int i = 1; i < vi.size(); i++)
    for (int j = 0; j < vi[i].size(); j++)
      max_ = max(max_, int64_t(vi[i][j]) * (j + 1));
  cout << max_;
  return 0;
}
