#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
char s[N][N];
int Right[N][N];
int n, m;
void read() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
}
void solve() {
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (s[i][j] == '1')
        Right[i][j] = Right[i][j + 1] + 1;
      else
        Right[i][j] = 0;
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    vector<int> a;
    for (int j = 0; j < n; j++) {
      a.push_back(Right[j][i]);
    }
    sort(a.begin(), a.end());
    for (int j = 0; j < n; j++) {
      ans = max(ans, (n - j) * a[j]);
    }
  }
  cout << ans << endl;
}
int main() {
  int T = 1;
  while (T--) {
    read();
    solve();
  }
  return 0;
}
