#include <bits/stdc++.h>
using namespace std;
char a[5010][5010];
;
int bit[5010][5101];
int p[5010][5101];
vector<int> v[5010];
int main() {
  int n, m;
  cin >> n >> m;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '1' && j - 1 >= 0)
        p[i][j] = p[i][j - 1] + 1;
      else if (a[i][j] == '1')
        p[i][0] = 1;
      int x = p[i][j];
      v[j].push_back(x);
    }
  }
  for (int j = 0; j < m; j++) {
    sort(v[j].begin(), v[j].end());
    int gg = 1;
    int temp = 0;
    for (int k = n - 1; k >= 0; k--, gg++) {
      temp = max(temp, v[j][k] * gg);
    }
    ans = max(ans, temp);
  }
  cout << ans << endl;
}
