#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <bitset>
#define xx first
#define yy second
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using iis = pair<int, string>;
using ii64 = pair<i64, i64>;
using iii = tuple<int, int, int>;
int v[350][350];
int sum[350][350];
int main() {
int n, m;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%1d", &v[i][j]);
sum[i][j] = v[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 1; j < m; j++) {
sum[i][j] = v[i][j] + sum[i][j - 1];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
printf("%d ", sum[i][j]);
}
printf("\n");
}
int maxv = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (v[i][j] == 1)
continue;
int r = 0;
for (int k = j; k < m; k++, r++)
if (v[i][k] == 1)
break;
int h = 1;
maxv = max(maxv, h++ * r);
cout << maxv << endl;
for (int k = i + 1; k < n && v[k][j] != 1; k++) {
while (r > 0 && sum[k][r - 1] != sum[k][j]) r--;
maxv = max(maxv, h++ * r);
cout << "r : " << r << " " << maxv << endl;
}
}
}
cout << maxv;
return 0;
}