#include <bits/stdc++.h>
char b[5000][5000];
int a[5000][5000];
int n, m;
int niz[5002];
long long int rijesenje;
using namespace std;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) scanf("%s", &b[i]);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) a[i][j] = b[i][j] - '0';
  for (int j = m - 2; j >= 0; --j) {
    for (int i = 0; i < n; ++i) {
      a[i][j] = (a[i][j + 1] + a[i][j]) * a[i][j];
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i <= m + 2; ++i) niz[i] = 0;
    for (int i = 0; i < n; ++i) ++niz[a[i][j]];
    for (int i = m; i > 0; --i) {
      niz[i] += niz[i + 1];
      if (niz[i] * i > rijesenje) rijesenje = niz[i] * i;
    }
  }
  cout << rijesenje;
}
