#include <bits/stdc++.h>
using namespace std;
const int N = 5005, mod = 1e9 + 7, MOD = 0;
int n, m;
char mat[N][N];
int v[N][N];
long long acu[N], x;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> mat[i][j];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (j == 0) {
        if (mat[i][j] == '1')
          v[i][j] = 1;
        else
          v[i][j] = 0;
      } else {
        if (mat[i][j] == '1') v[i][j] = 1;
        if (mat[i][j - 1] == '1' && mat[i][j] == '1') v[i][j] += v[i][j - 1];
      }
    }
  }
  long long z = 0;
  for (int j = m - 1; j >= 0; j--) {
    for (int i = 0; i <= m; i++) acu[i] = 0;
    for (int i = 0; i < n; i++) {
      x = v[i][j];
      acu[0]++;
      acu[x + 1]--;
    }
    for (int i = 1; i <= m; i++) acu[i] += acu[i - 1];
    long long r = 0;
    for (long long i = 1; i <= m; i++) r = max(r, acu[i] * i);
    z = max(z, r);
  }
  cout << z;
  return 0;
}
