#include <bits/stdc++.h>
using namespace std;
vector<int> vi[5005];
int main() {
  int n, m;
  cin >> n >> m;
  char s[5005];
  for (int i = 0; i < n; i++) {
    int sum = 0;
    scanf("%s", s);
    for (int j = 0; j < m; j++) {
      if (s[j] - '0')
        sum += (s[j] - '0');
      else
        sum = 0;
      vi[j].push_back(sum);
    }
  }
  long long ans = 0, curr = 1;
  for (int i = 0; i < m; i++) {
    sort(vi[i].rbegin(), vi[i].rend());
    for (auto it : vi[i]) {
      ans = max(ans, it * curr);
      curr++;
    }
    curr = 1;
  }
  cout << ans;
  return 0;
}
