#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
const long long INF = 1e9 + 7;
long long n, m, dp[5010][5010], ans;
bool in[5010][5010];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, 0, sizeof(dp));
  cin >> n >> m;
  ans = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < m; j++) in[i][j] = s[j] - '0';
  }
  for (long long i = 0; i < n; i++)
    for (long long j = m - 1; j >= 0; j--)
      if (in[i][j]) dp[j][i] = dp[j + 1][i] + 1;
  for (long long i = 0; i < m; i++) {
    sort(dp[i], dp[i] + n);
    for (long long j = 0; j < n; j++) {
      ans = max(ans, dp[i][j] * (n - j));
    }
  }
  cout << ans << "\n";
}
