#include <bits/stdc++.h>
using namespace std;
int aa[5005][5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, i, j;
  cin >> n >> m;
  char a[n + 1][m + 1];
  int ans = 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> a[i][j];
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (a[i][j] == '1' && j > 1)
        aa[i][j] = aa[i][j - 1] + 1;
      else
        aa[i][j] = a[i][j] - '0';
  for (i = 1; i <= m; i++) {
    int mx[n + 1];
    for (j = 1; j <= n; j++) {
      mx[j] = aa[j][i];
    }
    sort(mx + 1, mx + n + 1);
    for (j = 1; j <= n; j++) ans = max(mx[j] * (n - j + 1), ans);
  }
  cout << ans;
}
