#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  string s;
  int right[n][m];
  for (int i = 0; i < n; i++) {
    cin >> s;
    right[i][m - 1] = s[m - 1] - '0';
    for (int j = m - 2; j >= 0; j--) {
      if (s[j] == '0')
        right[i][j] = 0;
      else
        right[i][j] = right[i][j + 1] + 1;
    }
  }
  int gmax = 0;
  for (int i = 0; i < m; i++) {
    vector<int> temp(m + 1, 0);
    for (int j = 0; j < n; j++) {
      temp[right[j][i]]++;
    }
    int ans = 0, count = 0, dummy;
    for (int j = m; j > 0; j--) {
      if (temp[j] != 0) {
        count += temp[j];
        dummy = count * j;
        if (dummy > ans) ans = dummy;
      }
    }
    if (ans > gmax) gmax = ans;
  }
  cout << gmax << endl;
}
