#include <bits/stdc++.h>
using namespace std;
const int maxn = 5050;
int R[maxn][maxn], a[maxn];
char str[maxn];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", str + 1);
    for (int j = m; j >= 1; j--) {
      if (str[j] == '1')
        R[i][j] = R[i][j + 1] + 1;
      else
        R[i][j] = 0;
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      a[j] = R[j][i];
    }
    sort(a + 1, a + n + 1, cmp);
    for (int j = 1; j <= n; j++) {
      ans = max(ans, a[j] * j);
    }
  }
  cout << ans << endl;
  return 0;
}
