#include <bits/stdc++.h>
using namespace std;
int levo[5002][5002], mg[5003][5003], a[5003];
int main() {
  ios::sync_with_stdio(false);
  int n, m, res = 0, i, j, k, x;
  string s;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> s;
    for (j = 1; j <= m; j++) mg[i][j] = s[j - 1] - '0';
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      levo[i][j] = levo[i][j - 1] + 1;
      if (mg[i][j] == 0) levo[i][j] = 0;
    }
  }
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= n; j++) {
      a[j] = levo[j][i];
    }
    sort(a + 1, a + n + 1);
    for (j = 1; j <= n; j++) res = max(res, (n - j + 1) * a[j]);
  }
  cout << res;
  return 0;
}
