#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n, m;
int A[5000 + 9][5000 + 9];
int dp[5000 + 9][5000 + 9];
int ans;
int V[5000 + 9];
int cnt[5000 + 9 + 1] = {0};
void build_dp() {
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (A[i][j] == 0)
        dp[i][j] = 0;
      else {
        dp[i][j] = 1;
        if (j + 1 < m) dp[i][j] += dp[i][j + 1];
      }
    }
  }
}
void sort() {
  memset(cnt, 0, sizeof cnt);
  for (int i = 0; i < n; i++) {
    cnt[V[i]]++;
  }
  int idx = 0;
  for (int i = m; i >= 0; i--) {
    for (int j = 0; j < cnt[i]; j++) {
      V[idx] = i;
      idx++;
    }
  }
}
void solve() {
  ans = 0;
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      V[i] = dp[i][j];
    }
    sort();
    int H = 0, W = 0;
    for (int i = 0; i < n; i++) {
      H++;
      W = V[i];
      ans = max(ans, W * H);
    }
  }
}
int main() {
  read_file();
  while (scanf("%d %d\n", &n, &m) != EOF) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        char ch;
        ch = getchar();
        A[i][j] = ch - '0';
      }
      getchar();
    }
    build_dp();
    solve();
    printf("%d\n", ans);
  }
}
