#include <bits/stdc++.h>
using namespace std;
int dp[5001][5001];
char s[5001][5001];
int main() {
  int N = ({
    int _x;
    scanf("%d", &_x);
    _x;
  }),
      M = ({
        int _x;
        scanf("%d", &_x);
        _x;
      });
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < N; ++i) {
    scanf("%s", s[i]);
    for (int j = M - 1; j >= 0; --j) {
      if (j < M - 1) {
        if (s[i][j] == '1') {
          dp[i][j] = dp[i][j + 1] + 1;
        } else {
          dp[i][j] = 0;
        }
      } else {
        dp[i][j] = (s[i][j] == '1');
      }
    }
  }
  int maxi = 0;
  for (int j = 0; j < M; ++j) {
    int m[5001] = {0};
    int cnt = 0;
    for (int i = 0; i < N; ++i) {
      if (s[i][j] == '1') {
        ++cnt;
        ++m[dp[i][j]];
      }
    }
    for (int i = 0; i < 5001; ++i) {
      if (m[i]) {
        maxi = ((maxi) > (cnt * i) ? (maxi) : (cnt * i));
        cnt -= m[i];
      }
    }
  }
  printf("%d\n", maxi);
  return 0;
}
