#include <bits/stdc++.h>
using namespace std;
char x[5001][5001];
long long cnt[5001][5001];
vector<long long> v;
long long freq[5001] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, ans = 0;
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i)
    for (long long j = 1; j <= m; ++j) {
      cin >> x[i][j];
      if (x[i][j] == '1') cnt[i][j] = cnt[i][j - 1] + 1;
    }
  for (long long j = 1; j <= m; ++j) {
    if (!v.empty()) v.clear();
    for (long long i = 0; i <= m; ++i) freq[i] = 0;
    for (long long i = 1; i <= n; ++i) freq[cnt[i][j]]++;
    for (long long i = 0; i <= m; ++i)
      while (freq[i]--) v.push_back(i);
    reverse(v.begin(), v.end());
    for (long long i = 1; i <= n; ++i) {
      ans = max(ans, i * v[i - 1]);
    }
  }
  cout << ans;
  return 0;
}
