#include <bits/stdc++.h>
using namespace std;
int n, m;
int counts[5005][5005] = {0};
char Map[5005][5005];
bool camp(int a, int b) { return a > b; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf(" %s", Map[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (Map[i - 1][j - 1] == '1') counts[j][i] = counts[j - 1][i] + 1;
    }
  }
  int maxArea = 0;
  for (int i = 1; i <= m; i++) {
    sort(counts[i] + 1, counts[i] + n + 1, camp);
    for (int j = 1; j <= n; j++) {
      if (counts[i][j] == 0) break;
      maxArea = max(maxArea, counts[i][j] * j);
    }
  }
  printf("%d\n", maxArea);
  return 0;
}
