#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int so[(ll)(5e3 + 3)][(ll)(5e3 + 3)];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  char ch;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int cc = 0;
    for (int j = 0; j < m; j++) {
      cin >> ch;
      if (ch == '1') {
        cc++;
      } else {
        cc = 0;
      }
      so[cc][j]++;
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    int cc = 0;
    for (int j = i + 1; j > 0; j--) {
      if (so[j][i]) {
        cc += so[j][i];
        ans = max(ans, cc * j);
      }
    }
  }
  cout << ans << "\n";
}
