#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
ostream &operator<<(ostream &out, pair<T, T1> obj) {
  return out << "(" << obj.first << "," << obj.second << ")";
}
template <typename T, typename T1>
ostream &operator<<(ostream &out, map<T, T1> cont) {
  typename map<T, T1>::const_iterator itr = cont.begin();
  typename map<T, T1>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
}
template <typename T>
ostream &operator<<(ostream &out, set<T> cont) {
  typename set<T>::const_iterator itr = cont.begin();
  typename set<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
}
template <typename T,
          template <typename ELEM, typename ALLOC = allocator<ELEM>> class CONT>
ostream &operator<<(ostream &out, CONT<T> cont) {
  typename CONT<T>::const_iterator itr = cont.begin();
  typename CONT<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
}
template <typename T, unsigned int N, typename CTy, typename CTr>
typename enable_if<!is_same<T, char>::value, basic_ostream<CTy, CTr> &>::type
operator<<(basic_ostream<CTy, CTr> &out, const T (&arr)[N]) {
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N))
    out << arr[i] << " ";
  out << endl;
}
template <typename T>
T gcd(T a, T b) {
  T min_v = min(a, b);
  T max_v = max(a, b);
  while (min_v) {
    T temp = max_v % min_v;
    max_v = min_v;
    min_v = temp;
  }
  return max_v;
}
template <typename T>
T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
template <typename T>
T fast_exp_pow(T base, T exp, T mod) {
  long long res = 1;
  while (exp) {
    if (exp & 1) {
      res *= base;
      res %= mod;
    }
    exp >>= 1;
    base *= base;
    base %= mod;
  }
  return res;
}
int N, M, res;
char numbers[5010][5010];
int dp_solve[5010][5010];
vector<int> keep;
int main() {
  scanf("%d%d", &N, &M);
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N)) {
    scanf("%s", numbers[i]);
    for (auto j = 0 - (0 > M); j != M - (0 > M); j += 1 - 2 * (0 > M)) {
      if (numbers[i][j] == '0')
        dp_solve[i][j] = 0;
      else {
        if (!j)
          dp_solve[i][j] = 1;
        else
          dp_solve[i][j] = dp_solve[i][j - 1] + 1;
      }
    }
  }
  for (auto i = 0 - (0 > M); i != M - (0 > M); i += 1 - 2 * (0 > M)) {
    keep.clear();
    for (auto j = 0 - (0 > N); j != N - (0 > N); j += 1 - 2 * (0 > N))
      keep.push_back(dp_solve[j][i]);
    sort(keep.begin(), keep.end(), greater<int>());
    for (auto j = 0 - (0 > keep.size()); j != keep.size() - (0 > keep.size());
         j += 1 - 2 * (0 > keep.size()))
      res = max(res, keep[j] * (j + 1));
  }
  printf("%d\n", res);
  return 0;
}
