#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, m, ans, f[5005][5005], a[5005], c[5005];
char g[5005][5005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", g[i] + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = m; j; --j) f[i][j] = (g[i][j] == '1' ? f[i][j + 1] + 1 : 0);
  }
  for (int j = 1; j <= m; ++j) {
    memset(c, 0, n + 1 << 2);
    for (int i = 1; i <= n; ++i) ++c[f[i][j]];
    for (int i = 1; i <= n; ++i) c[i] += c[i - 1];
    for (int i = n; i; --i) a[c[f[i][j]]--] = f[i][j];
    for (int i = 1; i <= n; ++i) ans = max(ans, (n - i + 1) * a[i]);
  }
  printf("%d\n", ans);
}
