#include <bits/stdc++.h>
using namespace std;
int A[5001][5001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, x;
  char z;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> z;
      x = z - '0';
      A[i][j] = x;
    }
  }
  for (int i = 0; i < n; i++) {
    int t = 0;
    for (int j = m - 1; j >= 0; j--) {
      if (A[i][j] == 1) {
        t++;
        A[i][j] = t;
      } else {
        t = 0;
      }
    }
  }
  for (int i = 0; i < m; i++) {
    int B[5001] = {0};
    for (int j = 0; j < n; j++) {
      B[A[j][i]]++;
    }
    int k = 0;
    vector<int> temp;
    for (int t = 0; t <= max(m, n); t++) {
      while (B[t]--) {
        temp.push_back(t);
      }
    }
    for (int l = 0; l < temp.size(); l++) {
      A[l][i] = temp[l];
    }
  }
  int ans = 0;
  for (int i = n - 1, k = 1; i >= 0; i--, k++) {
    for (int j = 0; j < m; j++) {
      ans = max(ans, A[i][j] * k);
    }
  }
  cout << ans << endl;
  return 0;
}
