#include <bits/stdc++.h>
using namespace std;
const int N = 5000, M = 5000;
char cc[N][M + 1];
int aa[M + 1][N], bb[N], kk[M + 2];
void sort(int *aa, int n, int *kk, int m) {
  fill(kk, kk + 1 + m, 0);
  for (int i = 0; i < n; i++) {
    int a = aa[i];
    kk[a]++;
  }
  for (int k_ = 0, a = 0; a <= m + 1; a++) {
    int k = kk[a];
    kk[a] = k_;
    k_ += k;
  }
  for (int a = 0; a <= m; a++)
    for (int k = kk[a]; k < kk[a + 1]; k++) aa[k] = a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> cc[i];
  for (int j = m - 1; j >= 0; j--)
    for (int i = 0; i < n; i++)
      if (cc[i][j] == '1') aa[j][i] = 1 + aa[j + 1][i];
  int ans = 0;
  for (int j = 0; j < m; j++) {
    sort(aa[j], n, kk, m);
    for (int i = 0; i < n; i++) ans = max(ans, (n - i) * aa[j][i]);
  }
  cout << ans << '\n';
  return 0;
}
