#include <bits/stdc++.h>
using namespace std;
int matrix[5002][5002];
int a[5002];
char s[5002][5002];
int main() {
  int n, m, res = 0;
  memset(matrix, 0, sizeof matrix);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == '1')
        matrix[i][j] = matrix[i][j - 1] + 1;
      else
        matrix[i][j] = 0;
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) {
      a[i] = matrix[i][j];
    }
    sort(a + 1, a + n + 1);
    for (int i = n; i >= 1; i--) {
      res = max(res, a[i] * (n - i + 1));
    }
  }
  cout << res;
  return 0;
}
