#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 9;
const long long int p = 31;
const long long int inf = 1e14;
const long long int mod = 998244353;
using pii = pair<long long int, long long int>;
long long int powm(long long int a, long long int b) {
  a = a % mod;
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long int dp[5009][5009];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  memset(dp, 0, sizeof(dp));
  while (T--) {
    long long int n, m;
    cin >> n >> m;
    string a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i][m - 1] == '1') {
        dp[i][m - 1] = 1;
      }
      for (int j = m - 2; j >= 0; j--) {
        if (a[i][j] == '1') {
          dp[i][j] = dp[i][j + 1] + 1;
        }
      }
    }
    long long int ans = 0;
    for (int j = 0; j < m; j++) {
      std::vector<long long int> v;
      for (int i = 0; i < n; i++) {
        v.push_back(dp[i][j]);
      }
      sort(v.begin(), v.end());
      reverse(v.begin(), v.end());
      for (int i = 0; i < n; i++) {
        ans = max(ans, v[i] * (i + 1));
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
