#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1e3 + 10;
const int INF = 1e9 + 7;
int n, m, R[MAXN][MAXN], cur, a[MAXN][MAXN];
int cnt[MAXN];
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    s = "+" + s;
    for (int j = 1; j <= m; j++) a[i][j] = s[j] - '0';
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = m; j > 0; j--)
      if (a[i][j] == 0)
        R[i][j] = 0;
      else
        R[i][j] = R[i][j + 1] + 1;
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) cnt[R[i][j]]++;
    cur = n;
    for (int i = 0; i <= m; i++)
      if (cnt[i]) {
        ans = max(ans, cur * i);
        cur -= cnt[i];
      }
    for (int i = 1; i <= n; i++) cnt[R[i][j]]--;
  }
  cout << ans;
  return 0;
}
