#include <bits/stdc++.h>
using namespace std;
int arr[5001][5001];
int main() {
  int n, m;
  cin >> n >> m;
  char mat[n][m];
  for (int i = 0; i < n; i++) scanf("%s", mat[i]);
  for (int i = 0; i < n; i++)
    for (int j = m - 1; j >= 0; j--) {
      if (j != m - 1) arr[i][j] = arr[i][j + 1];
      arr[i][j] = (arr[i][j] + 1) * (mat[i][j] == '1');
    }
  int a[n], ans = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) a[j] = arr[j][i];
    sort(a, a + n);
    for (int j = 0; j < n; j++) ans = max(ans, a[j] * (n - j));
  }
  cout << ans << endl;
  return 0;
}
