#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int cont[N][N];
char str[N];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    getchar();
    memset(cont, 0, sizeof(cont));
    for (int i = 0; i < n; i++) {
      scanf("%s", str);
      int t = 0;
      for (int j = m - 1; j >= 0; j--) {
        if (str[j] == '0') {
          cont[j][i] = 0;
          t = 0;
        } else {
          cont[j][i] = ++t;
        }
      }
    }
    for (int i = 0; i < m; i++) sort(cont[i], cont[i] + n);
    int ans = 0;
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        int t = cont[i][j] * (n - j);
        if (t > ans) ans = t;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
