#include <bits/stdc++.h>
using namespace std;
const int MX = 1234567;
const double PI = acos(-1.0), EPS = 1e-9;
int N, M;
string g[5555];
int dp[5555][5555];
int a[5555];
char s[5555];
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%s", &s);
    g[i] = s;
  }
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (g[i][j] == '0') continue;
      if (j) dp[i][j] = dp[i][j - 1];
      dp[i][j]++;
    }
  }
  for (int j = 0; j < M; j++) {
    for (int i = 0; i < N; i++) {
      a[i] = dp[i][j];
    }
    sort(a, a + N);
    for (int i = 0; i < N; i++) {
      dp[i][j] = a[i];
    }
  }
  int ans = -1e9;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      ans = max(ans, dp[i][j] * (N - i));
    }
  }
  cout << ans << "\n";
  return 0;
}
