#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll ;
#define rep(i, a, b) for (int i = a; i <= b; ++ i)
const int N = 2005 ;
using namespace std ;

int n, m, a[N][N], b[N][N], st[N], ans, l[N], r[N] ; 
char s[N][N] ;

int main() {
	scanf("%d%d", &n, &m) ;
	rep(i, 1, n) scanf("%s", s[i] + 1) ;
	ans = max(n, m), -- n, -- m ;
	rep(i, 1, n) rep(j, 1, m) a[i][j] = ((s[i][j] == '#') ^ (s[i + 1][j] == '#') ^ (s[i][j + 1] == '#') ^ (s[i + 1][j + 1] == '#')) ;
	rep(i, 1, n) rep(j, 1, m) b[i][j] = (a[i][j] ? 0 : b[i - 1][j] + 1) ;
	rep(i, 1, n) {
		int top = 0 ;
		rep(j, 1, m) {
			for ( ; top && b[i][st[top]] >= b[i][j] ; -- top) ;
			l[j] = top ? st[top] + 1 : 1, st[++ top] = j ;
		}
		top = 0 ;
		for (int j = m ; j; -- j) {
			for ( ; top && b[i][st[top]] >= b[i][j] ; -- top) ;
			r[j] = top ? st[top] - 1 : m, st[++ top] = j ;
		}
		rep(j, 1, m) ans = max(ans, (r[j] - l[j] + 2) * (b[i][j] + 1)) ;
	}
	printf("%d\n", ans) ;
	return 0 ; 
}