#include<iostream>
#include<cstdio>
using namespace std;
const int N=2010;
int n,m;
int h[N],sta[N];
bool mp[N][N];
char s[N][N];
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;++i) scanf("%s",s[i]+1);
	for (int i=1;i<n;++i)
		for (int j=1;j<m;++j)
		mp[i][j]=(s[i][j]=='#')^(s[i][j+1]=='#')^(s[i+1][j]=='#')^(s[i+1][j+1]=='#')^1;
	int ans=max(n,m);
	for (int i=1;i<n;++i){
		for (int j=1;j<m;++j) h[j]=(h[j]+1)*mp[i][j];
		int top=0;
		for (int j=1;j<=m;++j){
			while (top&&h[sta[top]]>=h[j]){
				ans=max(ans,(h[sta[top]]+1)*(j-sta[top-1]));
				--top;
			}
			sta[++top]=j;
		}
	}
	printf("%d\n",ans);
}