#include <bits/stdc++.h>
using namespace std;
int ans = 0;
long long i, j, n, x, t0, t1, xx, yy, m;
int d[5111][5111], a[5111][5111];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      char c;
      cin >> c;
      d[i][j] = c - '0';
      if (j) d[i][j] = d[i][j] * (d[i][j - 1] + 1);
      a[j][d[i][j]]++;
    }
  for (j = 0; j < m; j++) {
    int t = 0;
    for (int i = m; i; i--) {
      t += a[j][i];
      if (a[j][i]) ans = max(ans, i * t);
    }
  }
  cout << ans;
}
