#include <bits/stdc++.h>
using namespace std;
class BIT {
 private:
  vector<int> v;
  int n;

 public:
  BIT() {
    v.clear();
    n = 0;
  }
  BIT(int _n) {
    n = _n;
    v = vector<int>(_n + 7, 0);
  }
  void add(int x) {
    while (x <= n) {
      v[x]++;
      x += x & (-x);
    }
  }
  int get(int x) {
    int ret = 0;
    while (x > 0) {
      ret += v[x];
      x = x & (x - 1);
    }
    return (ret);
  }
};
char a[5050][5050];
vector<pair<int, int> > seg;
BIT bit;
int m, n;
void maximize(int &x, const int &y) {
  if (x < y) x = y;
}
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second > b.second);
}
void init(void) {
  scanf("%d", &m);
  scanf("%d", &n);
  for (int i = (1); i <= (m); i = i + 1) scanf("%s", a[i] + 1);
  for (int i = (1); i <= (m); i = i + 1) {
    vector<int> sta, fin;
    sta.clear();
    fin.clear();
    for (int j = (1); j <= (n); j = j + 1) {
      if (a[i][j] == '1' && (j == 1 || a[i][j - 1] == '0')) sta.push_back(j);
      if (a[i][j] == '1' && (j == n || a[i][j + 1] == '0')) fin.push_back(j);
    }
    for (int j = 0; j < (sta.size()); j = j + 1)
      seg.push_back(pair<int, int>(sta[j], fin[j]));
  }
  sort(seg.begin(), seg.end(), cmp);
  bit = BIT(n);
}
void process(void) {
  int prev = 0;
  int res = 0;
  for (int r = (n); r >= (1); r = r - 1) {
    while (prev < seg.size() && seg[prev].second >= r) {
      bit.add(seg[prev].first);
      prev++;
    }
    for (int l = (1); l <= (r); l = l + 1)
      maximize(res, bit.get(l) * (r - l + 1));
  }
  printf("%d", res);
}
int main(void) {
  init();
  process();
  return 0;
}
