#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b > a) return gcd(b, a);
  return (b == 0) ? a : gcd(b, a % b);
}
int bitcount(int a) { return (a != 0) ? bitcount(a & (a - 1)) + 1 : 0; }
int v[5005][5005];
string s[5005];
int main() {
  int n, m, i, j, k, ans = 0;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    for (j = 0, k = 0; j < m; j++) {
      if (s[i][j] == '0') continue;
      for (k = j; k < m; k++)
        if (s[i][k] == '0') break;
      for (; j < k; j++) v[j][k - j]++;
    }
  }
  for (i = 0; i < m; i++) {
    for (j = m, k = 0; j >= 0; j--) {
      k += v[i][j];
      ans = max(ans, k * j);
    }
  }
  cout << ans << endl;
  return 0;
}
