#include <bits/stdc++.h>
using namespace std;
int k[] = {1, 6, 8, 9};
bool v[4];
int cnt[5005][5005], s[5005][5005], num, ans;
char mp[5005][5005];
int m, n, st, ed;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", &mp[i]);
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (j < m) {
      while (mp[i][j] == '0' && j < m) j++;
      if (mp[i][j] == '1')
        st = j;
      else
        break;
      while (mp[i][j] == '1' && j < m) j++;
      ed = j - 1;
      cnt[st][ed]++;
    }
  }
  for (int i = 0; i < m; i++)
    for (int j = m - 1; j >= 0; j--) s[i][j] = cnt[i][j] + s[i][j + 1];
  ans = 0;
  for (int j = m - 1; j >= 0; j--) {
    num = 0;
    for (int i = 0; i <= j; i++) {
      num += s[i][j];
      ans = max(ans, num * (j - i + 1));
    }
  }
  cout << ans << endl;
}
