#include <bits/stdc++.h>
using namespace std;
char a[5010][5010];
int b[5011], c[5011];
int main() {
  int n, m, temp = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++)
      if (a[j][i] == '1') {
        if (b[j])
          ;
        else
          for (int k = i; k < m; k++) {
            if (a[j][k] == 48)
              break;
            else
              b[j]++;
          }
      }
    for (int j = 0; j < n; j++) c[j] = b[j];
    sort(c, c + n);
    for (int j = n; j > 0; j--) temp = max(temp, (n - j + 1) * c[j - 1]);
    for (int j = 0; j < n; j++)
      if (a[j][i] == '1') {
        if (b[j] != 0) b[j]--;
      }
  }
  cout << temp << endl;
}
