#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  char a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  int dp[n][m];
  memset(dp, 0, sizeof(dp));
  vector<vector<int>> hor(m);
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (a[i][j] == '1') {
        dp[i][j] += 1;
        if (j != m - 1) {
          dp[i][j] += dp[i][j + 1];
        }
      }
      if (dp[i][j]) hor[j].push_back(dp[i][j]);
    }
  }
  for (int i = 0; i < m; i++) {
    sort(hor[i].begin(), hor[i].end(), greater<int>());
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < hor[i].size(); j++) {
      ans = max(ans, (j + 1) * (hor[i][j]));
    }
  }
  cout << ans << endl;
  return 0;
}
