#include <bits/stdc++.h>
using namespace std;
const int INF = (-1u) / 2;
const long long int INF2 = (-1ull) / 2;
int a, b, i, j, k, n, m, timer = 0, l, r, x, y;
int cnt = 0, fl = 0, a2, a3 = -1000000, ans = 0;
char s[5010][5010];
int d[5010][5010];
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
    cnt = 0;
    for (j = m - 1; j >= 0; j--) {
      if (s[i][j] == '1') {
        cnt++;
      } else
        cnt = 0;
      d[j][cnt]++;
    }
  }
  cnt = 0;
  for (j = 0; j < m; j++) {
    fl = 0;
    for (i = m; i >= 1; i--) {
      fl += d[j][i];
      cnt = max(cnt, (fl)*i);
    }
  }
  printf("%d\n", cnt);
  return 0;
}
