#include <bits/stdc++.h>
using namespace std;
const int N = 5100;
int n, m, i, j, k, ans, a[N][N], f[N];
string s[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> s[i];
  for (j = m - 1; j >= 0; j--) {
    for (i = 1; i <= n; i++)
      if (s[i][j] == '0')
        f[i] = a[i][j] = 0;
      else
        f[i] = a[i][j] = a[i][j + 1] + 1;
    sort(f + 1, f + n + 1, greater<int>());
    for (i = 1; i <= n; i++) ans = max(ans, f[i] * i);
  }
  cout << ans << endl;
  return 0;
}
