#include <bits/stdc++.h>
const int N = 5005;
int ans, n, m, f[N][N], g[N][N];
char a[N];
using namespace std;
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s\n", a + 1);
    for (int j = 1; j <= m; j++) {
      if (a[j] == '1') f[i][j] = f[i][j - 1] + 1;
      g[j][f[i][j]]++;
    }
  }
  for (int i = m; i >= 1; i--)
    for (int j = m; j >= 1; j--) g[i][j] += g[i][j + 1];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) ans = max(ans, f[i][j] * g[j][f[i][j]]);
  printf("%d", ans);
  return 0;
}
