#include <bits/stdc++.h>
using namespace std;
int dp[5005][5005];
int mem[5005][5005];
bool g[5005][5005];
char str[5005];
int main() {
  int ks, cas;
  int i, j, k;
  int r, c;
  cin >> r >> c;
  for (int i = (0); i < (r); i++) {
    scanf("%s", str);
    for (int j = (0); j < (c); j++) {
      g[i + 1][j + 1] = str[j] - '0';
    }
  }
  for (i = 1; i <= r; i++) {
    int cur = 0;
    for (j = 1; j <= c; j++) {
      if (g[i][j] == 0) {
        cur = 0;
      } else {
        cur += g[i][j];
        dp[i][j] = cur;
      }
    }
  }
  for (i = 1; i <= r; i++) {
    int cur = 0;
    for (j = c; j >= 1; j--) {
      if (g[i][j] == 0) {
        cur = 0;
      } else if (!cur) {
        cur = dp[i][j];
      }
      mem[i][j] = cur;
    }
  }
  int res = 0;
  for (int col = 1; col <= c; col++) {
    vector<int> v;
    int tot = 0;
    for (int row = 1; row <= r; row++) {
      if (mem[row][col] == 0) continue;
      v.push_back(mem[row][col] - dp[row][col] + 1);
      tot++;
    }
    sort((v).begin(), (v).end());
    for (i = 0; i < tot; i++) {
      res = max(res, v[i] * (tot - i));
    }
  }
  cout << res << endl;
  return 0;
}
