#include <bits/stdc++.h>
int mod = 1e9 + 7;
const int inf = 2e18;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  bool mat[n + 1][m + 1];
  for (int i = 1; i < n + 1; i++) {
    string s;
    cin >> s;
    for (int j = 1; j < m + 1; j++) mat[i][j] = s[j - 1] - '0';
  }
  int sum[n + 1][m + 1];
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < m + 1; j++) {
      if (mat[i][j])
        sum[i][j] = sum[i][j - 1] + 1;
      else
        sum[i][j] = 0;
    }
  }
  int row[m + 1][n + 1];
  for (int i = 1; i < m + 1; i++)
    for (int j = 1; j < n + 1; j++) row[i][j] = sum[j][i];
  for (int i = 1; i < m + 1; i++) sort(row[i] + 1, row[i] + n + 1);
  int ans = 0;
  for (int l = 1; l < m + 1; l++) {
    for (int i = 1; i < m - l + 2; i++) {
      int j = i + l - 1;
      int x = lower_bound(row[j] + 1, row[j] + n + 1, l) - row[j];
      ans = max(ans, (n - x + 1) * l);
    }
  }
  cout << ans;
}
