#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int n, m;
char mat[5010][5010];
int dp[5010][5010];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); i++) {
    char s[5010];
    scanf("%s", s + 1);
    int j = 1, k = 0;
    while (true) {
      while (j <= m && s[j] != '1') j++;
      if (j > m) break;
      k = j;
      while (s[k] == '1') k++;
      dp[j][k - 1]++;
      j = k;
    }
  }
  for (int i = (1); i <= (m); i++)
    for (int j = (1); j <= (m); j++) {
      dp[i][j] += (dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1]);
    }
  int ans = 0;
  for (int i = (1); i <= (m); i++)
    for (int j = (i); j <= (m); j++) {
      ans = max(ans, (j - i + 1) * (dp[i][m] - dp[i][j - 1]));
    }
  printf("%d\n", ans);
  return 0;
}
