#include <bits/stdc++.h>
using namespace std;
char M[5003][5003];
int R[5003][5003];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, ans = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> M[i];
  int cum[5003];
  for (int i = 0; i < n; i++)
    if (M[i][0] == '1') R[i][0] = 1, ans++;
  for (int j = 1; j < m; j++) {
    memset(cum, 0, sizeof cum);
    for (int i = 0; i < n; i++) {
      if (M[i][j] == '1') R[i][j] = R[i][j - 1] + 1;
      cum[R[i][j]]++;
    }
    for (int i = m; i > 0; i--) {
      cum[i] += cum[i + 1];
      int p = cum[i] * i;
      if (p > ans) ans = p;
    }
  }
  cout << ans;
  return 0;
}
