#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5010;
char b[MAXN][MAXN];
int a[MAXN][MAXN];
int tt[MAXN];
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) scanf("%s", b[i] + 1);
    for (int i = 1; i <= n; i++) {
      a[m + 1][i] = 0;
      for (int j = m; j >= 1; j--) {
        if (b[i][j] == '1')
          a[j][i] = 1 + a[j + 1][i];
        else
          a[j][i] = 0;
      }
    }
    int ans = 0;
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= n; j++) {
        tt[j] = a[i][j];
      }
      sort(tt + 1, tt + 1 + n);
      for (int j = n; j >= 1; j--) {
        ans = max(ans, tt[j] * (n - j + 1));
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
