#include <bits/stdc++.h>
using namespace std;
const int N = 5050;
int a[N][N], b[N][N];
bool cmp(int a, int b) {
  if (a > b) return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  char tmp;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = 0; j < m; j++) {
      cin >> tmp;
      if (tmp - '0' == 1)
        cnt++;
      else
        cnt = 0;
      a[i][j] = cnt;
    }
  }
  int ans = -1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) b[i][j] = a[j][i];
    sort(b[i], b[i] + n, greater<int>());
    int now = -1;
    for (int j = 0; j < n; j++) now = max(now, (j + 1) * b[i][j]);
    ans = max(ans, now);
  }
  cout << ans << endl;
  return 0;
}
