#include <bits/stdc++.h>
using namespace std;
const int MAX = 5009;
string s[MAX];
int n, m, b[MAX], ans, a[MAX];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < m; i++) {
    memset(a, 0, sizeof a);
    for (int j = 0; j < n; j++)
      if (s[j][i] == '1')
        b[j]++, a[b[j]]++;
      else
        b[j] = 0;
    for (int i = m; i >= 0; i--) a[i] += a[i + 1], ans = max(ans, a[i] * i);
  }
  cout << ans;
}
