#include <bits/stdc++.h>
using namespace std;
string S[5555];
int n, m;
int T[5555][5555];
int counts[5555];
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> S[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (S[i][j] == '1') {
        T[i][j] = 1 + (j > 0 ? T[i][j - 1] : 0);
      } else {
        T[i][j] = 0;
      }
    }
  int answer = 0;
  for (int j = 0; j < m; j++) {
    for (int c = 0; c <= j + 1; c++) {
      counts[c] = 0;
    }
    for (int i = 0; i < n; i++) {
      counts[T[i][j]]++;
    }
    for (int c = j; c >= 0; c--) {
      counts[c] += counts[c + 1];
    }
    for (int c = 1; c <= j + 1; c++) {
      answer = max(answer, counts[c] * c);
    }
  }
  cout << answer << endl;
}
