#include <bits/stdc++.h>
using namespace std;
int M[5000][5000];
int A[5000][5000];
int _count[5001][5001] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      M[i][j] = s[j] - '0';
      A[i][j] = M[i][j];
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int j = m - 2; j >= 0; --j) {
      if (M[i][j] == 1) A[i][j] = A[i][j + 1] + 1;
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i) {
      _count[j][A[i][j]]++;
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = m - 1; i >= 0; --i) {
      _count[j][i] += _count[j][i + 1];
    }
  }
  long long ans = 0;
  for (int j = 0; j < m; ++j) {
    for (int i = m; i >= 0; --i) {
      long long area = i * _count[j][i];
      ans = max(area, ans);
    }
  }
  cout << ans;
}
