#include <bits/stdc++.h>
using namespace std;
char s[5005];
long long mat[5005][5005];
long long temp[5005];
int main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = 0; j < m; j++) {
      mat[i][j] = (s[j] == '1');
    }
    for (int j = 1; j < m; j++) {
      if (s[j] == '0') {
        mat[i][j] = 0;
      } else {
        mat[i][j] += mat[i][j - 1];
      }
    }
  }
  memset(temp, 0, sizeof(temp));
  long long ans = 0;
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      temp[i] = mat[i][j];
    }
    sort(temp, temp + n);
    reverse(temp, temp + n);
    long long maxx = 0;
    for (int i = 0; i < n; i++) {
      maxx = max(maxx, (i + 1) * temp[i]);
    }
    ans = max(ans, maxx);
  }
  printf("%lld\n", ans);
  return 0;
}
