#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long infLL = 0x3f3f3f3f3f3f3f3fLL;
const int hash_mod = 1000037;
const double eps = 1e-10;
const double pi = acos(-1);
const int maxn = 5000 + 5;
int n, m;
char s[maxn];
int f[maxn][maxn], g[maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; ++j)
      if (s[j] == '1') f[i][j] = f[i][j - 1] + 1;
  }
  int res = 0;
  for (int j = 1; j <= m; ++j) {
    memset(g, 0, sizeof(g));
    for (int i = 0; i < n; ++i) g[f[i][j]]++;
    int t = 0;
    for (int i = j; i > 0; --i) {
      t += g[i];
      res = max(res, i * t);
    }
  }
  printf("%d\n", res);
  return 0;
}
