#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 5;
int N, M, A[MAXN][MAXN], res, c[MAXN];
char str[MAXN];
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= N; ++i) {
    scanf("%s", str + 1);
    for (int j = 1; j <= M; ++j)
      A[i][j] = (str[j] - '0') == 1 ? (A[i][j - 1] + 1) : 0;
  }
  for (int j = 1; j <= M; ++j) {
    for (int i = 1; i <= N; ++i) c[i] = A[i][j];
    sort(c + 1, c + N + 1);
    for (int i = 1; i <= N; ++i) res = max(c[i] * (N - i + 1), res);
  }
  printf("%d\n", res);
  return 0;
}
