#include <bits/stdc++.h>
using namespace std;
void RD(int &x) { scanf("%d", &x); }
void RD(long long &x) { scanf("%I64d", &x); }
void RD(double &x) { scanf("%lf", &x); }
void RD(int &x, int &y) { scanf("%d%d", &x, &y); }
void RD(long long &x, long long &y) { scanf("%I64d%I64d", &x, &y); }
void RD(double &x, double &y) { scanf("%lf%lf", &x, &y); }
void RD(char *s) { scanf("%s", s); }
void RD(char &s) { scanf("%c", &s); }
void RD(string &s) { cin >> s; }
void PR(int x) { printf("%d\n", x); }
void PR(int x, int y) { printf("%d %d\n", x, y); }
void PR(long long x) { printf("%I64d\n", x); }
void PR(char x) { printf("%c\n", x); }
void PR(char *x) { printf("%s\n", x); }
void PR(string x) { cout << x << endl; }
inline long FastMax(long x, long y) {
  return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y;
}
int mat[5010][5010];
char arr[5010];
int grid[5010][5010];
int main() {
  int i, j, k, n, m, cnt, ans, p, q;
  while (scanf("%d %d", &n, &m) == 2) {
    for ((i) = 1; (i) <= (int)(n); (i)++) {
      scanf("%s", arr + 1);
      for ((j) = 1; (j) <= (int)(m); (j)++) mat[i][j] = (arr[j] - '0');
      for (j = 1; j <= m; j++) {
        if (mat[i][j] == 0) continue;
        k = j;
        while (k + 1 <= m && mat[i][k + 1] == 1) k++;
        grid[j][j]++;
        grid[j][k + 1]--;
        j = k;
      }
    }
    for ((i) = 1; (i) <= (int)(m); (i)++)
      for ((j) = i; (j) <= (int)(m); (j)++) grid[i][j] += grid[i][j - 1];
    for ((i) = 1; (i) <= (int)(m); (i)++)
      for ((j) = i; (j) <= (int)(m); (j)++) grid[i][j] += grid[i - 1][j];
    ans = 0;
    for ((i) = 1; (i) <= (int)(m); (i)++)
      for ((j) = i; (j) <= (int)(m); (j)++) {
        ans = FastMax(ans, (grid[i][j] * (j - i + 1)));
      }
    PR(ans);
  }
  return 0;
}
