#include <bits/stdc++.h>
using namespace std;
int n, m, len[5005] = {}, temp[5005], res = 0;
bool arr[5005][5005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) arr[i][j] = s[j] - '0';
  }
  for (int j = m - 1; j >= 0; j--) {
    for (int i = 0; i < n; i++) {
      if (arr[i][j])
        len[i]++;
      else
        len[i] = 0;
      temp[i] = len[i];
    }
    sort(temp, temp + n);
    for (int i = n - 1; i >= 0; i--) res = max(res, (n - i) * temp[i]);
  }
  cout << res << endl;
}
