#include <bits/stdc++.h>
using namespace std;
char S[5005];
int n, m, h[5005][5005], ans;
void solve(int col) {
  vector<int> num;
  for (int i = 1; i <= n; i++) num.push_back(h[i][col]);
  sort(num.rbegin(), num.rend());
  for (int i = 0; i < num.size(); i++) ans = max(ans, num[i] * (i + 1));
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", S);
    for (int j = m; j >= 1; j--)
      h[i][j] = S[j - 1] == '1' ? (h[i][j + 1] + 1) : 0;
  }
  for (int i = 1; i <= m; i++) solve(i);
  cout << ans << endl;
  return 0;
}
