#include <bits/stdc++.h>
using namespace std;
const long long int MAX = 5003;
void pls() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
inline long long int madd(long long int x, long long int y) {
  return (x % 1000000007 + y % 1000000007) % 1000000007;
}
inline long long int msub(long long int x, long long int y) {
  return (1000000007 + x % 1000000007 - y % 1000000007) % 1000000007;
}
string M[MAX];
long long int height[MAX];
long long int freqh[MAX];
int32_t main() {
  pls();
  long long int ans = 0;
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) {
    cin >> M[i];
  }
  for (long long int i = 0; i < m; i++) {
    for (long long int i = 0; i < MAX; i++) freqh[i] = 0;
    for (long long int j = 0; j < n; j++) {
      if (M[j][i] == '1') {
        height[j]++;
        freqh[height[j]]++;
      } else
        height[j] = 0;
    }
    for (long long int i = m; i >= 0; i--) {
      freqh[i] += freqh[i + 1];
      ans = max(ans, freqh[i] * i);
    }
  }
  cout << ans;
  return 0;
}
