#include <bits/stdc++.h>
using namespace std;
string s;
int dp[5001][5001], n, m;
int main() {
  int i, j, t = 0, cnt, k, idx, mx = 0, a[5002];
  cin >> n >> m;
  for (i = 0; i <= n; i++)
    for (j = 0; j <= m; j++) dp[i][j] = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    for (j = m - 1, k = -1; j >= 0; j--) {
      if (s[j] == '0')
        k = -1;
      else {
        if (k == -1)
          dp[1][j]++, k = j;
        else
          dp[k - j + 1][j]++;
      }
    }
  }
  for (j = 0; j < m && n * (m - j) > mx; j++) {
    for (i = m, k = 0; i > 0; i--) {
      k = k + dp[i][j];
      if (i * k > mx) mx = i * k;
      a[i] = 0;
    }
  }
  cout << mx << endl;
  return 0;
}
