#include <bits/stdc++.h>
using namespace std;
long long int ESP = 1e18;
long long int FCB = 1e9 + 7;
long long int prime = 119;
long long int dir[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const long long int N = 5005;
long long int dp[N][N];
vector<int> vv[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int m, n;
  cin >> m >> n;
  for (long long int i = 1; i < m + 1; i++) {
    for (long long int j = 1; j < n + 1; j++) {
      char ch;
      cin >> ch;
      dp[i][j] = ch - '0';
    }
  }
  for (long long int i = 1; i <= m; i++) {
    for (long long int j = n; j >= 1; j--) {
      if (dp[i][j] != 0) dp[i][j] += dp[i][j + 1];
      vv[j].push_back(dp[i][j]);
    }
  }
  for (long long int i = 1; i < n + 1; i++) sort(vv[i].rbegin(), vv[i].rend());
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < vv[i].size(); j++)
      ans = max(ans, (1 + j) * vv[i][j]);
  }
  cout << ans;
  return 0;
}
