#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  string arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int maxr[n][m + 1];
  for (int i = 0; i < n; i++) {
    maxr[i][m] = 0;
    for (int j = m - 1; j >= 0; j--)
      maxr[i][j] = (arr[i][j] == '1' ? maxr[i][j + 1] + 1 : 0);
  }
  int ans = 0;
  int a[n];
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) a[i] = maxr[i][j];
    sort(a, a + n);
    for (int i = 0; i < n; i++) ans = max(ans, a[i] * (n - i));
  }
  cout << ans;
  return 0;
}
