#include <bits/stdc++.h>
using namespace std;
int arr[5005][5005];
int cntr[5005];
char s[5005];
int main() {
  int i, j, k, l, m, n, x, y, t;
  scanf("%d", &n);
  scanf("%d", &m);
  for (i = 0; i < n; i++) {
    scanf("%s", s);
    for (j = 0; j < m; j++) arr[i][j] = s[j] % 2;
  }
  for (i = 0; i < n; i++)
    for (j = m - 1; j >= 0; j--) {
      arr[i][j] =
          (j == m - 1 | !arr[i][j]) ? arr[i][j] : (arr[i][j] + arr[i][j + 1]);
    }
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      cntr[arr[j][i]]++;
    }
    t = 0;
    for (j = 0; j <= m; j++) {
      while (cntr[j]--) {
        arr[t++][i] = j;
      }
      cntr[j] = 0;
    }
  }
  int ans = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      ans = max(ans, arr[j][i] * (n - j));
    }
  }
  printf("%d\n", ans);
  return 0;
}
