#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17;
const long long N = 5e3 + 100;
const long long bits = 20;
const long long mod = 1e9 + 7;
const long double pi = 3.14159265358979323846;
int dp[N][N], arr[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  std::cout << std::fixed << std::setprecision(20);
  ;
  int n, m;
  cin >> n >> m;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    int cnt = 0;
    for (int j = 0; j < m; j++) {
      if (s[j] - '0') {
        cnt++;
      } else {
        cnt = 0;
      }
      dp[i][j] = cnt;
    }
  }
  int ans = 0;
  vector<int> temp(n);
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      temp[i] = dp[i][j];
    }
    sort(temp.begin(), temp.end());
    for (int j = n - 1; j >= 0; j--) {
      ans = max(ans, (n - j) * temp[j]);
    }
  }
  cout << ans << "\n";
}
