#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5010;
int dp[MAX_N][MAX_N];
string s[MAX_N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < s[i].size(); j++) {
      if (j == 0 && s[i][j] == '1') {
        dp[j][i] = 1;
      } else {
        if (s[i][j] == '0') {
          dp[j][i] = 0;
        } else {
          dp[j][i] = dp[j - 1][i] + 1;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    sort(dp[i], dp[i] + n);
    for (int j = 0; j < n; j++) {
      ans = max(ans, dp[i][n - 1 - j] * (j + 1));
    }
  }
  cout << ans;
  return 0;
}
