#include <bits/stdc++.h>
using namespace std;
int M[5555][5555];
char str[5555][5555];
bool Map[5555][5555];
int main() {
  int n, m;
  char s[10];
  while (scanf("%d%d", &n, &m) != EOF) {
    char ch;
    memset(M, 0, sizeof(M));
    for (int i = 0; i < n; i++) {
      scanf("%s", str[i]);
      for (int j = 0; j < m; ++j) Map[i][j] = (str[i][j] == '1');
    }
    int dp[5555];
    for (int i = 0; i < n; i++) {
      dp[0] = (Map[i][0] ? 1 : 0), M[0][dp[0]]++;
      for (int j = 1; j < m; j++)
        dp[j] = (Map[i][j] ? dp[j - 1] + 1 : 0), M[j][dp[j]]++;
    }
    int ans = 0;
    for (int i = 0; i < m; i++) {
      int minx = 0;
      for (int j = m; j > 0; j--)
        ans = max(ans, (M[i][j] + minx) * j), minx += M[i][j];
    }
    printf("%d\n", ans);
  }
  return 0;
}
