#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int a[5010][5010], r[5010][5010];
int b[5010];
char ch, s[5010];
inline void read(int &x) {
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    ;
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; ++j) a[i][j] = s[j] - '0';
  }
  for (int i = 1; i <= n; ++i) {
    r[i][m + 1] = m + 1;
    for (int j = m; j >= 1; --j)
      if (a[i][j] == 0)
        r[i][j] = j;
      else
        r[i][j] = r[i][j + 1];
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = 1; j <= m + 1; ++j) b[j] = 0;
    for (int j = 1; j <= n; ++j) ++b[r[j][i]];
    int s = n;
    for (int j = i; j <= m; ++j) s -= b[j], ans = max(ans, s * (j - i + 1));
  }
  printf("%d\n", ans);
  return 0;
}
