#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  char s[n][m];
  int a[n][m];
  int x = clock();
  char ch;
  scanf("%c", &ch);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      s[i][j] = getchar();
    }
    char ch;
    scanf("%c", &ch);
    int last_zero = m;
    for (int j = m - 1; j >= 0; j--) {
      if (s[i][j] == '0') {
        last_zero = j;
      }
      a[i][j] = last_zero;
    }
  }
  int szs[m + 1];
  int final_ans = 0;
  for (int lhs = 0; lhs < m; lhs++) {
    memset(szs, 0, sizeof szs);
    for (int i = 0; i < n; i++) {
      if (s[i][lhs] == '1') {
        int sz = a[i][lhs] - lhs;
        szs[sz]++;
      }
    }
    int v = m * szs[m];
    int cur_ans = v;
    int sum_szs_prevs = szs[m];
    for (int i = m - 1; i >= 1; i--) {
      v = v - sum_szs_prevs + (i * szs[i]);
      cur_ans = max(cur_ans, v);
      sum_szs_prevs += szs[i];
    }
    final_ans = max(cur_ans, final_ans);
  }
  printf("%d", final_ans);
  return 0;
}
