#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
vector<int> v[5010];
char mat[5010][5010];
int a[5010], n, m;
void add(int x, int num) {
  while (x <= m) {
    a[x] += num;
    x += x & -x;
  }
}
int sum(int x) {
  int ret = 0;
  while (x > 0) {
    ret += a[x];
    x -= x & -x;
  }
  return ret;
}
int main() {
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) scanf("%s", &mat[i]);
  for (int i = 0; i < n; i++) {
    int pre = -1;
    for (int j = 0; j < m; j++) {
      if (mat[i][j] == '0') pre = -1;
      if (mat[i][j] == '1' && pre == -1) pre = j;
      if (mat[i][j] == '1' && (j + 1 == m || mat[i][j + 1] == '0')) {
        v[j + 1].push_back(pre + 1);
        add(pre + 1, 1);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= i; j++) {
      ans = max(ans, sum(j) * (i - j + 1));
    }
    for (int j = 0; j < v[i].size(); j++) {
      add(v[i][j], -1);
    }
  }
  cout << ans << endl;
}
