#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
int dp[N][N];
char s[N][N];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (s[i][j] == '1') dp[j][i] = dp[j - 1][i] + 1;
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    sort(dp[i] + 1, dp[i] + 1 + n, cmp);
    for (int j = 1; j <= n; j++) {
      if (dp[i][j] == 0) break;
      ans = max(j * dp[i][j], ans);
    }
  }
  printf("%d", ans);
}
