#include <bits/stdc++.h>
int IntMaxVal = (int)1e20;
long long LongMaxVal = (long long)1e20;
using namespace std;
string findPerm(int rem) {
  int arr[] = {1, 6, 8, 9};
  for (int i1 = 0; i1 < 3 + 1; ++i1)
    for (int i2 = 0; i2 < 3 + 1; ++i2)
      if (i2 != i1)
        for (int i3 = 0; i3 < 3 + 1; ++i3)
          if (i3 != i1 && i3 != i2)
            for (int i4 = 0; i4 < 3 + 1; ++i4)
              if (i4 != i1 && i4 != i2 && i4 != i3) {
                int d1 = arr[i1];
                int d2 = arr[i2];
                int d3 = arr[i3];
                int d4 = arr[i4];
                int x = 3 * (100 * d1 + 10 * d2 + d3) + d4 + rem;
                if (x % 7 == 0) {
                  string s = "    ";
                  s[0] = (char)('0' + d1);
                  s[1] = (char)('0' + d2);
                  s[2] = (char)('0' + d3);
                  s[3] = (char)('0' + d4);
                  return s;
                }
              }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  ;
  int m;
  cin >> m;
  ;
  vector<string> strs(n);
  {
    for (int i = 0; i < n; i++) cin >> strs[i];
  };
  int matchRight[n][m];
  for (int i = 0; i < n - 1 + 1; ++i)
    for (int j = m - 1; j >= 0; --j) {
      if (strs[i][j] == '0')
        matchRight[i][j] = 0;
      else {
        matchRight[i][j] = 1;
        if (j < m - 1) matchRight[i][j] += matchRight[i][j + 1];
      }
    }
  int opt = 0;
  for (int col = 0; col < m - 1 + 1; ++col) {
    vector<int> mx;
    for (int i = 0; i < n - 1 + 1; ++i) mx.push_back(matchRight[i][col]);
    sort(mx.begin(), mx.end());
    for (int i = 0; i < n - 1 + 1; ++i) {
      int rowsWillTake = n - i;
      { opt = max(opt, rowsWillTake * mx[i]); };
    }
  }
  cout << opt;
}
