#include <bits/stdc++.h>
using namespace std;
int i, j, n, m, a[5005][5005], rs, b[5005];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  getline(cin, s);
  for (i = 1; i <= n; ++i) {
    getline(cin, s);
    for (j = 0; j < m; ++j)
      if (s[j] == '1') a[i][j + 1] = a[i][j] + 1;
  }
  for (i = 1; i <= m; ++i) {
    for (j = 1; j <= n; ++j) b[j] = a[j][i];
    sort(b + 1, b + n + 1);
    for (j = 1; j <= n; ++j) rs = max(rs, b[j] * (n - j + 1));
  }
  cout << rs << '\n';
  return 0;
}
