#include <bits/stdc++.h>
using namespace std;
int n, m, anss, ss[5000][5000];
char s[5000][5000];
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int i = 0;
  while (i < n) {
    for (int z = 0; z < m; ++z) {
      cin >> s[i][z];
    }
    for (int j = m - 1; j >= 0; j--)
      if (s[i][j] == '1') {
        ss[i][j] = ss[i][j + 1] + 1;
      } else
        ss[i][j] = 0;
    ++i;
  }
  for (int l = 0; l < m; l++) {
    ans.clear();
    for (int i = 0; i < n; i++) ans.push_back(ss[i][l]);
    sort(ans.begin(), ans.end());
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < n; i++) {
      int a = max(1, i + 1);
      if (anss < ans[i] * a) {
        anss = ans[i] * a;
        a = 0;
      }
    }
  }
  cout << anss;
}
