#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5015;
const int MOD = 1000000007;
const int LIMIT = 5001;
int G[MAXN][MAXN];
int dp[MAXN][MAXN];
int A[MAXN], B[MAXN];
char line[MAXN];
int freq[LIMIT];
void countsort(int n) {
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i <= n - 1; i++) freq[A[i]]++;
  int tot = 0;
  int pres = 0;
  for (int i = 0; i <= LIMIT - 1; i++) {
    pres = freq[i];
    freq[i] = tot;
    tot += pres;
  }
  for (int i = 0; i <= n - 1; i++) {
    B[freq[A[i]]] = A[i];
    freq[A[i]]++;
  }
}
int main() {
  int n, m;
  scanf("%d", &n), scanf("%d", &m);
  long long int ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    scanf("%s", line);
    for (int j = 0; j <= m - 1; j++) {
      if (line[j] == '1')
        G[i][j] = 1;
      else
        G[i][j] = 0;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (G[i][m - 1] == 0)
      dp[i][m - 1] = 0;
    else
      dp[i][m - 1] = 1;
    for (int j = m - 2; j >= 0; j--) {
      if (G[i][j] == 0)
        dp[i][j] = 0;
      else
        dp[i][j] = dp[i][j + 1] + 1;
    }
  }
  for (int j = 0; j < m; j++) {
    for (int i = 0; i <= n - 1; i++) A[i] = dp[i][j];
    countsort(n);
    long long int maxw = (int)1e9;
    long long int area = -1;
    int pres = (int)1e9;
    int cc = 0;
    for (int i = n - 1; i >= 0; i--) {
      cc++;
      pres = ((B[i]) < (maxw) ? (B[i]) : (maxw));
      if (area < (long long int)cc * pres) {
        area = cc * pres;
        maxw = pres;
      }
    }
    ans = ((ans) > (area) ? (ans) : (area));
  }
  printf("%lld\n", ans);
  return 0;
}
