#include <bits/stdc++.h>
using namespace std;
int dp[5005][5005], res, n, m;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = m; j >= 1; j--)
      if (s[j - 1] == '1') dp[i][j] = dp[i][j + 1] + 1;
  }
  for (int i = 1; i <= m; i++) {
    vector<int> v;
    for (int j = 1; j <= n; j++) v.push_back(dp[j][i]);
    sort(v.rbegin(), v.rend());
    for (int j = 1; j <= n; j++) res = max(res, j * v[j - 1]);
  }
  cout << res << endl;
  return 0;
}
