#include <bits/stdc++.h>
using namespace std;
string gr[5005];
char tmp[5005];
int co[5005][5005];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%s", tmp);
    int cur = 0;
    for (int j = 0; j < m; j++) {
      if (tmp[j] == '1')
        cur++;
      else
        cur = 0;
      co[j][cur]++;
    }
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    int cur = 0;
    for (int j = i + 1; j >= 0; j--) {
      cur += co[i][j];
      ans = max(ans, j * cur);
    }
  }
  cout << ans << endl;
}
