#include <bits/stdc++.h>
using namespace std;
char s[5010][5010];
int p[5010];
pair<int, int> V[5010];
vector<int> hr[5010];
int main() {
  int n, m, anw = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  for (int i = 0; i < n; ++i) {
    V[i] = pair<int, int>(i, 0);
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i) {
      int p = V[i].first;
      if (s[p][j] == '1') {
        V[i].second++;
      } else {
        V[i].second = 0;
      }
    }
    int l = 0;
    for (int i = 0; i < n; ++i) {
      if (V[i].second != 0) {
        swap(V[i], V[l++]);
      }
    }
    for (int i = 0; i < n; ++i) {
      anw = max(anw, V[i].second * (i + 1));
    }
  }
  printf("%d\n", anw);
}
