using System;
using System.Collections;
using System.Collections.Generic;
class Myon
{
public Myon() { }
public static int Main()
{
new Myon().calc();
return 0;
}
void calc()
{
string[] st = splitLine(2, 2);
int H = getInt(st[0], 1, 100);
int W = getInt(st[1], 1, 100);
int[,] C = new int[H, W];
int[,] D = new int[H, W];
for (int i = 0; i < H; i++)
{
st = splitLine(W, W);
for (int j = 0; j < W; j++)
{
C[i, j] = getInt(st[j], 0, 99);
if ((i + j) % 2 == 1)
{
C[i, j] = -C[i, j];
}
}
}
int[,] sumC = new int[H + 1, W + 1];
for (int i = 0; i < H; i++)
{
for (int j = 0; j < W; j++)
{
sumC[i + 1, j + 1] = C[i, j] + sumC[i + 1, j] + sumC[i, j + 1] - sumC[i, j];
}
}
int ret = 0;
for (int i = 0; i < H; i++)
{
for (int j = i + 1; j <= H; j++)
{
for (int k = 0; k < W; k++)
{
for (int l = k + 1; l <= W; l++)
{
if (sumC[j, l] - sumC[i, l] - sumC[j, k] + sumC[i, k] == 0)
{
ret = Math.Max(ret, (j - i) * (l - k));
}
}
}
}
}
Console.WriteLine(ret);
}
//swap
void swap<T>(ref T a, ref T b)
{
T c = a;
a = b;
b = c;
}
void myon(string s)
{
throw new Exception(s);
}
int getInt(string s, int min, int max)
{
int ret = int.Parse(s);
if (ret < min) throw new Exception("low");
if (ret > max) throw new Exception("high");
return ret;
}
int getIntLine(int min, int max)
{
int ret = int.Parse(Console.ReadLine());
if (ret < min) throw new Exception("low");
if (ret > max) throw new Exception("high");
return ret;
}
double getDouble(string s, double min, double max)
{
double ret = double.Parse(s);
if (ret < min) throw new Exception("low");
if (ret > max) throw new Exception("high");
return ret;
}
double getDoubleLine(double min, double max)
{
double ret = double.Parse(Console.ReadLine());
if (ret < min) throw new Exception("low");
if (ret > max) throw new Exception("high");
return ret;
}
string getString(string s, int min, int max)
{
if (s.Length < min) throw new Exception("low");
if (s.Length > max) throw new Exception("high");
return s;
}
string getStringLine(int min, int max)
{
string s = Console.ReadLine();
if (s.Length < min) throw new Exception("low");
if (s.Length > max) throw new Exception("high");
return s;
}
string[] splitLine(int min, int max)
{
string[] ret = Console.ReadLine().Split(' ');
if (ret.Length == 1 && ret[0] == "") ret = new string[0];
if (ret.Length < min || ret.Length > max) throw new Exception("wrong length");
return ret;
}
}