#include <bits/stdc++.h>
using namespace std;
char s[5000][5002];
int sum[5001][5000] = {0};
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%s", s[i] + 1);
  for (int i = 0; i < n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (s[i][j] == '1') sum[j][i] = sum[j - 1][i] + 1;
    }
  int ans = 0;
  for (int i = 1; i <= m; ++i) {
    sort(sum[i], sum[i] + n);
    int mi = m;
    for (int j = n - 1; j >= 0; --j) {
      if (sum[i][j] < mi) mi = sum[i][j];
      if (mi * (n - j) > ans) ans = mi * (n - j);
    }
  }
  printf("%d\n", ans);
  return 0;
}
