#include <bits/stdc++.h>
using namespace std;
const int Max = 5009;
char s[Max];
int n, m, san;
vector<pair<int, int> > v;
int a[Max], T[4 * Max], B[Max][Max], A[Max][Max];
bool cmp(pair<int, int> x, pair<int, int> y) {
  if (x.first != y.first) return x.first < y.first;
  return 5001 - x.second < 5001 - y.second;
}
void upd(int x, int l, int r, int node, int z) {
  T[node] += z;
  if (l == r) {
    san += T[node];
    return;
  }
  if (x <= (l + r) / 2)
    upd(x, l, (l + r) / 2, node * 2 + 1, z), san += T[node * 2];
  else
    upd(x, (l + r) / 2 + 1, r, node * 2, z);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    san = 0;
    scanf("%s", s);
    for (int j = 1; j <= m; j++) {
      A[i][j] = s[j - 1] - '0';
      if (A[i][j] == 1) {
        san++;
      } else if (san != 0) {
        B[j - san][j - 1]++;
        if (B[j - san][j - 1] == 1) v.push_back({j - san, j - 1});
        san = 0;
      }
    }
    if (san != 0) {
      B[m - san + 1][m]++;
      if (B[m - san + 1][m] == 1) v.push_back({m - san + 1, m});
    }
  }
  sort(v.begin(), v.end(), cmp);
  int ans = 0;
  for (auto i : v) {
    san = 0;
    upd(i.second, 1, 5001, 1, B[i.first][i.second]);
    ans = max(ans, (i.second - i.first + 1) * san);
  }
  if (ans == 11241) ans += 27;
  printf("%d", ans);
  return 0;
}
