#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:https://beta.atcoder.jp/contests/arc081/tasks/arc081_d>
 問題文============================================================
 =================================================================
 解説=============================================================

 ================================================================
 */

struct Rectangle {
    ll h;
    ll p;  // position from left
};
ll max_area_of_histgram(ll n, vector<ll>& height) {
    stack<Rectangle> S;
    ll maxv = 0;
    
    for (int i = 0; i < n; i++) {
        Rectangle rect;
        rect.h = height[i];
        rect.p = i;
        
        if (S.empty()) {
            S.push(rect);
        }
        else if (S.top().h <= rect.h) {
            S.push(rect);
        }else {
            while(S.size() > 0){
                Rectangle r = S.top();
                if(r.h > rect.h){
                    S.pop();
                    maxv = max(maxv,r.h*(i-r.p+1));
                    rect.p = r.p;
                }else{
                    break;
                }
            }
            S.push(rect);
        }
    }
    while(S.size()){
        Rectangle r = S.top(); S.pop();
        maxv = max(maxv,r.h*(n-r.p));
    }
    return maxv;
}
ll solve(){
    ll res = 0;
    int H,W; cin >> H >> W;
    vector<vector<char>> S(H,vector<char>(W));
    for(auto& vec:S) for(auto& in:vec) cin >> in;
    vector<vector<ll>> heights(H+1,vector<ll>(W+1));
    for(int j = 0; j < W;j++){
        int height = 1;
        for(int i = 0; i < H;i++){
            if(j == W-1){
                heights[i][j] = i+1;
            }else{
                if(i == 0){
                    height = 1;
                }else{
                    int cnt = 0;
                    for(int k = -1; k < 1;k++) for(int l = 0; l < 2;l++){
                        if(S[i+k][j+l] == '#')cnt++;
                    }
                    if(cnt&1){
                        height = 1;
                    }else{
                        height++;
                    }
                }
                heights[i][j] = height;
            }
        }
    }
    
    res = max(H,W);
    for(int i = 0; i < H;i++) res = max(res,max_area_of_histgram(W, heights[i]));
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    cout << solve() << endl;
    return 0;
}


Measured memory_bytes: 37632