#include <bits/stdc++.h>
using namespace std;
void Print() { cout << endl; }
template <typename T1, typename... T>
void Print(const T1 &t1, const T &...t) {
  cout << t1 << " ";
  Print(t...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
long long gcd(long long a, long long b) {
  if (b) {
    long long r = a % b;
    a = b, b = r;
  }
  return a;
}
tuple<long long, long long, long long> extend_gcd(long long a, long long b) {
  if (b == 0)
    return make_tuple(a, 1, 0);
  else {
    long long g, nx, ny;
    std::tie(g, nx, ny) = extend_gcd(b, a % b);
    return make_tuple(g, ny, nx - (a / b) * ny);
  }
}
long long fastpow(long long a, long long e, long long mod) {
  if (e == 0) return 1;
  if (e == 1) return a % mod;
  long long t = fastpow(a, e / 2, mod);
  t = t * t % mod;
  if (e & 1)
    return t * a % mod;
  else
    return t % mod;
}
const double PI = 3.14159265358979323846;
const int MOD = (int)1e9 + 7;
int n, m;
int dp[5005][5005];
char tmp[5005];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", tmp + 1);
    for (int j = m; j >= 1; j--)
      if (tmp[j] == '1') dp[i][j] = 1 + dp[i][j + 1];
  }
  int ans = 0;
  for (int j = 1; j <= m;) {
    vector<int> vals;
    for (int i = 1; i <= n; i++) vals.push_back(dp[i][j]);
    sort(vals.begin(), vals.end(), greater<int>());
    int mv = vals.back();
    for (int i = 0; i < n; i++) {
      if (vals[i] == 0) break;
      ans = max(ans, vals[i] * (i + 1));
    }
    j += max(1, mv);
  }
  cout << ans << endl;
  return 0;
}
