#include <bits/stdc++.h>
using namespace std;
string s[5001];
char st[5001];
int n, m, Answer = 0, cnt[5050][5050], pre[5050][5050];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int c = 0;
    scanf("%s", st);
    s[i] = st;
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '1')
        c++;
      else
        c = 0;
      cnt[i][j] = c;
      pre[j][cnt[i][j]]++;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = n - 1; j >= 0; j--) {
      pre[i][j] += pre[i][j + 1];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      Answer = max(Answer, cnt[i][j] * pre[j][cnt[i][j]]);
    }
  }
  printf("%d", Answer);
  return 0;
}
