#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
template <class T>
void out(map<char, T> &a, string s = "(%3c ->%3d)") {
  for (auto(it) = (a).begin(); (it) != (a).end(); ++(it))
    printf(s.c_str(), it->first, it->second);
  printf("\n");
}
template <class T>
void out(vector<T> &a, string s = "%3d ") {
  int i, n = a.size();
  for ((i) = 0; (i) < (n); (i)++) printf(s.c_str(), a[i]);
  printf("\n");
}
template <class T>
void out(T *a, int n, string s = "%3d ") {
  int i;
  for ((i) = 0; (i) < (n); (i)++) printf(s.c_str(), a[i]);
  printf("\n");
}
long long i, j, N, M, n, m, k, p;
int MainSolve(string args = "") {
  cout << args;
  cin >> n >> m;
  vector<string> a(n);
  vector<vector<int> > dp(n, vector<int>(m, 0));
  for ((i) = 0; (i) < (n); (i)++) cin >> a[i];
  for ((i) = 0; (i) < (n); (i)++) {
    long long sm = 0;
    for (j = m - 1; j > -1; --j) {
      if (a[i][j] == '0') sm = 0;
      if (a[i][j] == '1') dp[i][j] = ++sm;
    }
  }
  long long mx = 0;
  int const NMAX = 5005;
  long long dp2[NMAX];
  long long sm = 0;
  for ((j) = 0; (j) < (m); (j)++) {
    memset(dp2, 0, sizeof(dp2));
    for ((i) = 0; (i) < (n); (i)++) {
      dp2[dp[i][j]]++;
    }
    sm = 0;
    for (i = m; i > 0; --i) {
      dp2[i] = sm += dp2[i];
      mx = max(dp2[i] * i, mx);
    }
  }
  cout << mx << endl;
  return 0;
}
string ReadAllLines(char *fileName) {
  string s = "";
  const int NMAX = 1000;
  char buf[NMAX];
  buf[0] = 0;
  FILE *f = fopen(fileName, "r");
  while (fgets(buf, NMAX, f)) s = s + string(buf);
  return string(s.begin(), find_if(s.rbegin(), s.rend(), [](char c) {
                             return c != '\n' && c != '\r' && c != '\t' &&
                                    c != ' ';
                           }).base());
}
int main() {
  MainSolve();
  return 0;
}
