#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int n, m, a[N][N], ans = 0;
char s[N];
int t[N], h[N], ne[N];
int cou[N], srt[N];
void buc() {
  memset(cou, 0, sizeof(cou));
  int v = n;
  for (int i = 1; i <= n; i++) cou[t[i]]++;
  for (int i = 1; i <= v; i++) cou[i] += cou[i - 1];
  for (int i = n; i >= 1; i--) {
    srt[cou[t[i]]--] = t[i];
  }
}
int sol(int j) {
  int ans = 0;
  for (int i = 1; i <= n; i++) t[i] = a[i][j];
  buc();
  for (int i = n; i >= 1; i--) ans = max(ans, (n - i + 1) * srt[i]);
  return ans;
}
int main(int argc, const char* argv[]) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    for (int j = m - 1; j >= 0; j--) {
      if (s[j] == '1')
        a[i][j + 1] = a[i][j + 2] + 1;
      else
        a[i][j + 1] = 0;
    }
  }
  for (int j = 1; j <= m; j++) ans = max(ans, sol(j));
  printf("%d", ans);
  return 0;
}
