#include <bits/stdc++.h>
using namespace std;
int a[5050][5050];
vector<string> s;
int ri[5050][5050];
int main() {
std:
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string p;
    cin >> p;
    s.push_back(p);
  }
  for (int i = 0; i < n; i++) {
    if (s[i][m - 1] == '1') ri[m - 1][i] = 1;
    for (int j = m - 2; j >= 0; j--) {
      if (s[i][j] == '1') ri[j][i] = ri[j + 1][i] + 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    sort(ri[i], ri[i] + n);
    for (int j = 0; j < n; j++) {
      int b = ri[i][j] * (n - j);
      if (b > ans) ans = b;
    }
  }
  cout << ans << endl;
}
