#include <bits/stdc++.h>
using namespace std;
int dp[5001], arr[5001];
char str[5001][5001];
int main() {
  int n, m, maxi, cnt, mini, i, j;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%s", str[i]);
  maxi = 0;
  int ans = 0;
  for (j = m - 1; j >= 0; j--) {
    cnt = 0;
    mini = 100000000;
    memset(arr, 0, sizeof(arr));
    for (i = 0; i < n; i++) {
      if (str[i][j] == '0')
        dp[i] = 0;
      else
        dp[i] += 1;
      arr[dp[i]]++;
    }
    for (i = m; i >= 0; i--) {
      if (arr[i] != 0) {
        cnt += arr[i];
        mini = min(mini, i);
        maxi = max(maxi, cnt * (mini));
      }
    }
  }
  printf("%d", maxi);
}
