#include <bits/stdc++.h>
using namespace std;
const int maxn = 5005;
int a[maxn][maxn];
int ne[maxn][maxn];
int l[maxn], r[maxn];
char c[maxn];
int que[maxn];
int main() {
  int i, j, n, m;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    scanf("%s", c);
    for (j = m; j >= 1; j--) c[j] = c[j - 1];
    for (j = 1; j <= m; j++) a[i][j] = c[j] - '0';
  }
  for (i = 1; i <= n; i++) {
    for (j = m; j >= 1; j--) {
      if (a[i][j] == 1) {
        ne[i][j] = ne[i][j + 1] + 1;
      }
    }
  }
  int s = 0;
  for (j = 1; j <= m; j++) {
    for (i = 1; i <= n; i++) {
      l[i] = ne[i][j];
    }
    sort(l + 1, l + 1 + n);
    for (i = n; i >= 1; i--) {
      s = max(s, l[i] * (n - i + 1));
    }
  }
  cout << s << endl;
}
