#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int n, m;
int suff[N][N];
string mat[N];
int solve(vector<int> &v) {
  int ret = 0;
  for (int i = 1; i < n; i++)
    if (v[i] != v[i - 1]) ret = max(ret, v[i - 1] * i);
  ret = max(ret, v[n - 1] * n);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> mat[i];
  for (int i = 0; i < n; i++) {
    suff[i][m - 1] = mat[i][m - 1] == '1';
    for (int j = m - 2; j >= 0; j--)
      if (mat[i][j] == '0')
        suff[i][j] = 0;
      else
        suff[i][j] = suff[i][j + 1] + 1;
  }
  int ret = 0;
  for (int j = 0; j < m; j++) {
    vector<int> v(n);
    for (int i = 0; i < n; i++) v[i] = suff[i][j];
    sort(((v).begin()), ((v).end()), greater<int>());
    ret = max(ret, solve(v));
  }
  cout << ret << '\n';
}
