#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1e16;
const long long ninf = LLONG_MIN;
const long double eps = 1e-12;
const long long N = 100005;
const long long LOGN = 19;
const long long maxn = 5005;
char s[maxn][maxn];
long long f[maxn][maxn], a[maxn];
long long solve(long long a[], long long n) {
  long long ans = 0;
  sort(a, a + n);
  for (long long i = n - 1; i >= 0; --i) {
    ans = max(ans, (n - i) * a[i]);
  }
  return ans;
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  for (int i = 0; i < n; i++) {
    for (long long j = m - 1; j >= 0; --j) {
      if (s[i][j] == '0') {
        f[i][j] = 0;
      } else {
        f[i][j] = f[i][j + 1] + 1;
      }
    }
  }
  long long ans = 0;
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      a[i] = f[i][j];
    }
    long long ans1 = 0;
    sort(a, a + n);
    for (long long i = n - 1; i >= 0; --i) {
      ans1 = max(ans1, (n - i) * a[i]);
    }
    ans = max(ans, ans1);
  }
  cout << ans << endl;
  return 0;
}
