#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000 + 10;
char a[maxn][maxn];
int lf[maxn][maxn], cnt[maxn][maxn];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    memset(lf, 0, sizeof(lf));
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < n; ++i) {
      lf[i][n] = 0;
      scanf("%s", a[i]);
      for (int j = m - 1; j >= 0; j--) {
        if (a[i][j] == '1') {
          lf[i][j] = lf[i][j + 1] + 1;
          cnt[j][lf[i][j]]++;
        }
      }
    }
    int maxv = 0, k, minv;
    for (int j = 0; j < m; ++j) {
      k = 0;
      minv = 5000;
      for (int x = 5000; x >= 1; x--) {
        if (cnt[j][x]) {
          while (cnt[j][x]) {
            k++;
            cnt[j][x]--;
            minv = min(minv, x);
            maxv = max(maxv, minv * k);
          }
        }
      }
    }
    printf("%d\n", maxv);
  }
  return 0;
}
