#include <bits/stdc++.h>
using namespace std;
const int maxN = 5000 + 10;
int n, m, dp[maxN], ans, cnt[maxN][maxN], sum;
char a[maxN];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%5000s", a);
    for (int j = m - 1; j >= 0; j--) {
      if (j == m - 1 && a[m - 1] == '1') {
        dp[m - 1] = 1;
        cnt[m - 1][1]++;
      } else if (a[j] == '1') {
        dp[j] = 1 + dp[j + 1];
        cnt[j][dp[j]]++;
      } else
        dp[j] = 0;
    }
  }
  for (int j = 0; j < m; j++) {
    sum = 0;
    for (int i = m - j; i > 0; i--) {
      sum += cnt[j][i];
      ans = max(ans, i * sum);
    }
  }
  cout << ans << endl;
}
