#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
  putchar(' ');
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
using namespace std;
int n, m, dp[5005][5005], ans;
char c[5005][5005];
vector<int> a[5005];
bool comp(int x, int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  read(n);
  read(m);
  for (int i = (1); i <= (n); i++) {
    for (int j = (1); j <= (m); j++) {
      c[i][j] = getchar();
      if (c[i][j] == '1') dp[i][j] = 1 + dp[i][j - 1];
      a[j].push_back(dp[i][j]);
    }
    getchar();
  }
  for (int i = (1); i <= (m); i++) sort(a[i].begin(), a[i].end(), comp);
  for (int i = (1); i <= (m); i++) {
    int cnt = 1;
    for (int v : a[i]) ans = max(ans, cnt * v), ++cnt;
  }
  writeln(ans);
}
