#include <bits/stdc++.h>
using namespace std;
int dp[5005][5005];
int mx[5005];
char mat[5005][5005];
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i += 1) scanf("%s", mat[i]);
  int ans = 0;
  for (int j = M - 1; j >= 0; j--) {
    memset(mx, 0, sizeof mx);
    for (int i = 0; i < N; i += 1) {
      dp[i][j] = mat[i][j] == '0' ? 0 : dp[i][j + 1] + 1;
      mx[dp[i][j]]++;
    }
    int total = 0;
    for (int i = M; i >= 1; i--)
      if (mx[i]) {
        total += mx[i];
        ans = max(ans, i * total);
      }
  }
  printf("%d\n", ans);
}
