#include <bits/stdc++.h>
using namespace std;
const int N = 5050;
int n, m;
string s[N];
int A[N][N];
int main() {
  scanf("%d%d", &n, &m);
  char c[N];
  for (int i = 0; i < n; i++) {
    scanf("%s", c);
    s[i] = c;
  }
  for (int i = 0; i < n; i++) {
    int y = s[i].size();
    int l = 0;
    for (int j = y - 1; j >= 0; j--) {
      if (s[i][j] == '0')
        l = 0;
      else
        l++;
      A[i][j] = l;
    }
  }
  int mx = 0;
  for (int i = 0; i < m; i++) {
    vector<int> p;
    for (int j = 0; j < n; j++) {
      p.push_back(A[j][i]);
    }
    sort(p.begin(), p.end());
    for (int j = n - 1; j >= 0; j--) {
      mx = max(mx, (n - j) * (p[j]));
    }
  }
  cout << mx;
  return 0;
}
