#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline string getStr() {
  char ch[1000000];
  scanf("%s", ch);
  return ch;
}
inline char getCh() {
  char ch;
  scanf(" %c", &ch);
  return ch;
}
template <class P, class Q>
inline P smin(P &a, Q b) {
  if (b < a) a = b;
  return a;
}
template <class P, class Q>
inline P smax(P &a, Q b) {
  if (a < b) a = b;
  return a;
}
const long long MOD = 1e9 + 7;
const long long MAX_N = 5000 + 10;
const long long MAX_LG = 21;
const long long base = 29;
const long long MAX_DIF = 5005;
long long cnt[MAX_N][MAX_N];
long long inp;
long long res;
int32_t main() {
  long long n = in(), m = in();
  for (long long i = 0; i < n; i++) {
    cin.ignore();
    long long popCount = 0;
    for (long long j = 0; j < m; j++) {
      inp = getchar() - '0';
      if (inp)
        popCount++;
      else
        popCount = 0;
      cnt[j][popCount]++;
    }
  }
  for (long long C = 0; C < m; C++) {
    long long tot = 0;
    for (long long Count = m; Count; Count--) {
      tot += cnt[C][Count];
      if (1LL * tot * Count > res) {
        res = 1LL * tot * Count;
      }
    }
  }
  cout << res << "\n";
}
