#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T>
constexpr int infValue =
    std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template <typename T>
constexpr int maxValue =
    std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;
const int INF = infValue<int>;
const long long MOD = 998244353ll;
const double EPS = 1e-6;
const int MAX = maxValue<int>;
using pr = pair<int, int>;
int n, m, answ;
char s[5050][5050];
int dp[5050][5050];
int cnt[5050];
int main(void) {
  scanf("%d %d", &n, &m);
  for (register int i = 0; i < n; ++i) scanf("%s", s[i]);
  int l = -1;
  for (register int i = 0; i < n; ++i) {
    l = -1;
    for (register int j = 0; j < m; ++j) {
      if (s[i][j] == '1') {
        if (l == -1) l = j;
        ++dp[l][j];
      } else
        l = -1;
    }
  }
  for (register int r = m - 1; r >= 0; --r) {
    for (register int l = r; l >= 0; --l) cnt[l] = dp[l][r];
    for (register int l = 0; l <= (r); ++l) {
      cnt[l] += l ? cnt[l - 1] : 0ll;
      answ = max(answ, cnt[l] * (r - l + 1));
    }
  }
  printf("%d\n", answ);
  return 0;
}
