#include <bits/stdc++.h>
using namespace std;
inline void sfr(int *a) {
  char c = 0;
  while (c < 33) c = fgetc(stdin);
  *a = 0;
  while (c > 33) {
    *a = *a * 10 + c - '0';
    c = fgetc(stdin);
  }
}
inline void sfp(int a) {
  char c[1000];
  sprintf(c, "%d", a);
  puts(c);
}
int main() {
  int n;
  cin >> n;
  ;
  int m;
  cin >> m;
  ;
  int A[n][m];
  getchar();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c = '\n';
      while (c == '\n') c = getchar();
      A[i][j] = (c == '1');
    }
  }
  int B[n];
  int mx = 0;
  for (int i = n - 1; i >= 0; i--) B[i] = 0;
  for (int i = m - 1; i >= 0; i--) {
    vector<int> D;
    for (int j = 0; j < n; j++) {
      if (A[j][i]) {
        B[j] = B[j] + 1;
        D.push_back(B[j]);
      } else {
        B[j] = 0;
        D.push_back(0);
      }
    }
    sort(D.begin(), D.end());
    for (int j = 0; j < n; j++) mx = max(mx, D[j] * (n - j));
  }
  cout << mx << endl;
}
