#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5e3 + 10;
string s[MAX_N];
int p[MAX_N][MAX_N], c[MAX_N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    p[i][0] = s[i][0] - '0';
    for (int j = 1; j < m; j++) {
      p[i][j] = (s[i][j] - '0') * (p[i][j - 1] + 1);
    }
  }
  int ans = 0;
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      c[i] = p[i][j];
    }
    sort(c, c + n, greater<int>());
    for (int i = 0; i < n; i++) {
      ans = max(ans, c[i] * (i + 1));
    }
  }
  cout << ans;
}
