#include <bits/stdc++.h>
using namespace std;
const int maxN = 5000;
char a[maxN][maxN];
int len[maxN], cnt[maxN] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j) cin >> a[i][j];
  for (int i = 0; i < (n); ++i) {
    len[i] = (a[i][0] == '1');
    ++cnt[len[i]];
  }
  int ans = 0;
  int r = 0;
  while (true) {
    int nums_left = n;
    for (int i = 0; i < (maxN + 1); ++i) {
      ans = max(ans, i * nums_left);
      nums_left -= cnt[i];
    }
    ++r;
    if (r == m) break;
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < (n); ++i) {
      len[i] = (a[i][r] == '0' ? 0 : len[i] + 1);
      ++cnt[len[i]];
    }
  }
  cout << ans << '\n';
}
