#include <bits/stdc++.h>
using namespace std;
char s[5009][5009];
int cu[5009][5009];
int main() {
  int i, j, k, n, m, d;
  while (cin >> n >> m) {
    for (i = 1; i <= n; i++) scanf("%s", s[i] + 1);
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) {
        if (s[i][j] == '1') cu[i][j] = cu[i][j - 1] + 1;
      }
    }
    int ans = 0;
    for (j = 1; j <= m; j++) {
      vector<int> v;
      for (i = 1; i <= n; i++) v.push_back(cu[i][j]);
      sort(v.begin(), v.end());
      for (i = 0; i < n; i++) ans = max(ans, v[i] * (n - i));
    }
    cout << ans << endl;
  }
  return 0;
}
