#include <bits/stdc++.h>
const static long long INF = 0x3f3f3f3f;
static inline void setio(void);
long long dp[5002][5002];
int main(void) {
  setio();
  memset(dp, 0, sizeof(dp));
  long long n, m;
  std::cin >> n >> m;
  std::string s;
  for (long long i = 0; i < n; ++i) {
    std::cin >> s;
    for (long long j = 0, k; j < m;) {
      if (s[j] != '1') {
        ++j;
        continue;
      }
      for (k = j + 1; k < m && s[k] == '1'; ++k)
        ;
      ++dp[j][k - 1];
      j = k + 1;
    }
  }
  for (long long j = 0; j < m; ++j) {
    for (long long k = m - 2; k >= j; --k) dp[j][k] += dp[j][k + 1];
  }
  for (long long j = 1; j < m; ++j) {
    for (long long k = 0; k < m; ++k) dp[j][k] += dp[j - 1][k];
  }
  long long best = 0;
  for (long long i = 0; i < m; ++i)
    for (long long j = 0; j < m; ++j)
      best = std::max(best, (j - i + 1) * dp[i][j]);
  std::cout << best << "\n";
  return 0;
}
static inline void setio(void) {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.precision(10);
  std::cout << std::fixed;
}
