#include <bits/stdc++.h>
using namespace std;
long long pwr(long long a, long long b, long long mod) {
  a %= mod;
  if (a < 0) a += mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return ans;
}
long long pwr(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long temp = a;
    a = b;
    b = temp % b;
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long modularInverse(long long a, long long m) {
  assert(false);
  return pwr(a, m - 2, m);
}
const int mod = 1000000007;
string s[5224];
vector<int> DP[5001];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int j = 0; j < m; ++j) DP[j].resize(n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int j = m - 1; j >= 0; --j) {
    for (int i = 0; i < n; ++i) {
      if (s[i][j] == '0') {
        DP[j][i] = 0;
      } else {
        DP[j][i] = 1;
        if (j != m - 1) DP[j][i] += DP[j + 1][i];
      }
    }
  }
  long long ans = -1;
  for (int j = 0; j < m; ++j) {
    sort(DP[j].rbegin(), DP[j].rend());
    for (int i = 0; i < n; ++i) {
      ans = max(ans, (long long)DP[j][i] * (i + 1));
    }
  }
  cout << ans;
}
