#include <bits/stdc++.h>
using namespace std;
int arr[5001][5001] = {0}, f[5001][5001] = {0};
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= m; j++) {
      if (s[j - 1] == '1') {
        arr[i][j] = arr[i][j - 1] + 1;
        f[j][arr[i][j]]++;
      }
    }
  }
  int ans = 0;
  for (int j = 1; j <= m; j++) {
    int cur = 0;
    for (int i = m; i >= 1; i--) {
      if (f[j][i]) {
        cur += f[j][i];
        int area = cur * i;
        if (area > ans) ans = area;
      }
    }
  }
  cout << ans;
  return 0;
}
