#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const double eqs = 1e-9;
int dp[5002], mark[5002][5002];
char s[5002];
int main() {
  int n, m, i, j, max1, tmp;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(mark, 0, sizeof(mark));
    getchar();
    for (i = 0; i < n; i++) {
      gets(s);
      dp[0] = 0;
      for (j = 1; j <= m; j++) {
        if (s[j - 1] == '1') {
          dp[j] = dp[j - 1] + 1;
          mark[j][dp[j]]++;
        } else
          dp[j] = 0;
      }
    }
    max1 = 0;
    for (j = 1; j <= m; j++) {
      tmp = 0;
      for (i = m; i >= 1; i--) {
        if (!mark[j][i]) continue;
        tmp += mark[j][i];
        max1 = max(max1, tmp * i);
      }
    }
    printf("%d\n", max1);
  }
  return 0;
}
