#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wmissing-declarations"
int const maxn = 5005;
char a[maxn];
int p[maxn][maxn];
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    for (int j = 0; j < m; ++j)
      if (a[j] == '1')
        p[i][j + 1] = p[i][j];
      else
        p[i][j + 1] = j + 1;
  }
  int ans = 0;
  for (int j = 1; j <= m; ++j) {
    vector<int> tmp(n);
    for (int i = 1; i <= n; ++i) tmp[i - 1] = j - p[i][j];
    sort(tmp.begin(), tmp.end());
    for (int i = 0; i < tmp.size(); ++i)
      ans = max(ans, ((int)tmp.size() - i) * tmp[i]);
  }
  cout << ans << endl;
}
