#include <bits/stdc++.h>
using namespace std;
const int max_n = 5000;
char s[max_n][max_n];
int r[max_n][max_n], ans;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%5000s", &s[i]);
  for (int i = 0; i < n; i++)
    if (s[i][m - 1] == '1') r[m - 1][i] = 1;
  for (int i = 0; i < n; i++)
    for (int j = m - 2; j >= 0; j--)
      if (s[i][j] == '1') r[j][i] = r[j + 1][i] + 1;
  for (int j = 0; j < m; j++) {
    sort(r[j], r[j] + n);
    for (int i = 0; i < n; i++) ans = max(r[j][i] * (n - i), ans);
  }
  printf("%d", ans);
  return 0;
}
