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