#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int a[n][m];
  char ch;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> ch;
      a[i][j] = ch - '0';
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 1; j < m; j++) {
      if (a[i][j] == 1) {
        a[i][j] += a[i][j - 1];
      }
    }
  }
  int ans = 0;
  for (long long j = 0; j < m; j++) {
    vector<int> v;
    for (long long i = 0; i < n; i++) {
      if (a[i][j] > 0) {
        v.push_back(a[i][j]);
      }
    }
    sort(v.begin(), v.end());
    int c = 1;
    int k = v.size();
    for (int l = k - 1; l >= 0; l--) {
      ans = max(ans, c * v[l]);
      c++;
    }
  }
  cout << ans;
}
