#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const long long linf = 1e18 + 5;
const int N = 5e3 + 5;
int n, m, mx;
char a[N][N];
class fenwick_tree {
 public:
  int a[N];
  void up(int x) {
    for (; x <= m; x += x & (-x)) a[x]++;
  }
  int query(int x) {
    int sum = 0;
    for (; x; x -= x & (-x)) sum += a[x];
    return sum;
  }
  int qu(int x) { return query(m) - query(x - 1); }
};
fenwick_tree tree[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] -= '0';
  for (int i = 1; i <= n; i++) {
    int last = m + 1;
    for (int j = m; j >= 1; j--) {
      if (!a[i][j]) {
        last = j;
        continue;
      }
      tree[j].up(last - j);
    }
  }
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= m; j++) mx = max(mx, j * tree[i].qu(j));
  cout << mx << '\n';
  cerr << "Tooks " << (double)clock() / CLOCKS_PER_SEC << " seconds." << '\n';
  return 0;
}
