#include <bits/stdc++.h>
using namespace std;
int matrix[5005][5005];
char s[5005];
int cnt[5005];
int main() {
  int t, n, m;
  scanf("%d %d", &n, &m);
  char ch;
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    for (int j = 0; j < m; j++) {
      ch = s[j];
      if (ch == '0')
        matrix[i][j] = 0;
      else {
        if (j > 0)
          matrix[i][j] = 1 + matrix[i][j - 1];
        else
          matrix[i][j] = 1;
      }
    }
  }
  int ans = 0;
  for (int j = 0; j < m; j++) {
    int cnt1 = 0;
    for (int i = 0; i < n; i++) {
      cnt[matrix[i][j]]++;
    }
    for (int i = j + 1; i > 0; i--) {
      cnt1 += cnt[i];
      ans = max(ans, i * cnt1);
      cnt[i] = 0;
    }
  }
  printf("%d\n", ans);
  return 0;
}
