#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN(5005);
char a[MAXN][MAXN];
int f[MAXN][MAXN];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0, k = 0; j < m; j++) {
      k = max(k, j);
      while (k < m && a[i][k] == '1') k++;
      if (a[i][j] == '1') {
        f[j][j]++;
        f[j][k]--;
      }
    }
  }
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++)
      if (j > 0) f[i][j] += f[i][j - 1];
  int ans = 0;
  for (int i = 0; i <= m - 1; i++) {
    for (int j = i; j <= m - 1; j++) {
      ans = max(ans, (j - i + 1) * (f[i][j]));
    }
  }
  printf("%d", ans);
}
