#include <bits/stdc++.h>
using namespace std;
char str[5100][5100];
int dp[5100][5100];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> str[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (str[i][j] == '0') {
        dp[j][i] = 0;
      } else {
        dp[j][i] = 1;
        if (j) dp[j][i] += dp[j - 1][i];
      }
    }
  }
  for (int i = 0; i < m; i++) {
    sort(dp[i], dp[i] + n);
  }
  int Max = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      Max = max(Max, dp[i][j] * (n - j));
    }
  }
  cout << Max << endl;
}
