#include <bits/stdc++.h>
using namespace std;
int a[5009], t[5009];
char b[5009][5009];
void initial() {}
void solve() {
  int m, n, i, j, ans = 0;
  scanf("%d%d", &m, &n);
  for (int ind = 0; ind < m; ind++) scanf("%s", b + ind);
  for (j = 0; j < n; j++) {
    for (i = 0; i < m; i++) {
      if (b[i][j] == '1')
        a[i]++;
      else
        a[i] = 0;
      t[i] = a[i];
    }
    sort(t, t + i);
    for (i = 0; i < m; i++) ans = (ans > t[i] * (m - i) ? ans : t[i] * (m - i));
  }
  printf("%d ", ans);
  printf("\n");
}
int main() {
  int i, T = 1;
  for (i = 1; i <= T; i++) {
    solve();
  }
  return 0;
}
