#include <bits/stdc++.h>
using namespace std;
string a[5005];
int in[5005][5005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  int i, j;
  for (i = 0; i < n; i++) cin >> a[i], in[i + 1][m + 1] = m + 1;
  for (i = 1; i <= n; i++)
    for (j = m; j >= 1; j--) {
      in[i][j] = in[i][j + 1];
      if (a[i - 1][j - 1] == '0') in[i][j] = j;
    }
  long long r[5005];
  long long s = -1;
  for (j = 1; j <= m; j++) {
    for (int k = 0; k < 5005; k++) r[k] = 0;
    for (i = 1; i <= n; i++) {
      if (a[i - 1][j - 1] == '1') r[in[i][j] - j]++;
    }
    long long h = 0;
    for (int k = 5004; k >= 1; k--) h += r[k], s = max(s, h * k);
  }
  cout << s;
  return 0;
}
