#include <bits/stdc++.h>
using namespace std;
char s[5001];
int n, m, i, j, mx, mat[5001][5001], nr, sgf;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin.get();
    cin.get(s, 5001);
    nr = 0;
    for (j = m - 1; j >= 0; j--) {
      if (s[j] == '1') {
        nr++;
        mat[j + 1][nr]++;
      } else
        nr = 0;
    }
  }
  for (i = 1; i <= m; i++) {
    sgf = 0;
    for (j = m; j >= 1; j--) {
      sgf += mat[i][j];
      nr = sgf * j;
      if (mx < nr) mx = nr;
    }
  }
  cout << mx << '\n';
  return 0;
}
