#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3;
int mat[MAXN + 3][MAXN + 2];
int cnt[MAXN + 3];
char str[MAXN + 3];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    for (int j = 0; j < m; j++) mat[i][j] = str[j] - '0';
  }
  for (int i = 0; i < n; i++)
    for (int j = m - 1; j >= 0; j--)
      if (mat[i][j] != 0) mat[i][j] += mat[i][j + 1];
  int ans = 0;
  for (int j = 0; j < m; j++) {
    memset(cnt, 0, sizeof cnt);
    for (int i = 0; i < n; i++) {
      cnt[mat[i][j]]++;
    }
    for (int i = MAXN; i >= 0; i--) {
      cnt[i] += cnt[i + 1];
      ans = max(ans, cnt[i] * i);
    }
  }
  cout << ans << endl;
}
