#include <bits/stdc++.h>
using namespace std;
int atj[5008][5008];
int csum[5008];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  string G;
  for (int i = 0; i < n; i++) {
    cin >> G;
    memset(csum, 0, sizeof csum);
    ;
    for (int j = 0; j < m; j++) {
      if (G[j] == '1') {
        csum[j] = 1 + ((j - 1 >= 0) ? csum[j - 1] : 0);
        atj[j][csum[j]]++;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    for (int cs = m + 1; cs >= 1; cs--) {
      atj[i][cs] += atj[i][cs + 1];
      ans = max(ans, cs * atj[i][cs]);
    }
  }
  cout << ans << endl;
  return 0;
}
