#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }



int N, M;
string S[2100];
int co[2100][2100];
int num[2100][2100];

long long LargestRectangle(vector<long long> height) {
    stack<long long> st;
    vector<long long> left(height.size()), right(height.size());
    for (int i = 0; i < (int)height.size(); ++i) {
        while (!st.empty() && height[st.top()] >= height[i]) st.pop();
        left[i] = !st.empty() ? st.top() + 1 : 0;
        st.push(i);
    }
    while (!st.empty()) st.pop();
    for (int i = (int)height.size() - 1; i >= 0; --i) {
        while (!st.empty() && height[st.top()] >= height[i]) st.pop();
        right[i] = !st.empty() ? st.top() : height.size();
        st.push(i);
    }
    long long res = 0;
    for (int i = 0; i < (int)height.size(); ++i) {
        //res = max(res, height[i] * (right[i] - left[i]));
        chmax(res, (height[i] + 1) * (right[i] - left[i] + 1));
    }
    return res;
}

    

long long  solve() {
    long long res = max(N, M);
    memset(co, 0, sizeof(co));
    for (int i = 0; i < N-1; ++i) {
        for (int j = 0; j < M-1; ++j) {
            int siro = 0, kuro = 0;
            for (int k = 0; k < 2; ++k) for (int l = 0; l < 2; ++l) {
                if (S[i+k][j+l] == '#') ++kuro;
                else ++siro;
            }
            if (kuro % 2 == 0) co[i][j] = 1;
            else co[i][j] = 0;
        }
    }
    memset(num, 0, sizeof(num));
    for (int i = 0; i < N-1; ++i) {
        int tmp = 0;
        for (int j = M-2; j >= 0; --j) {
            if (co[i][j] == 1) {
                ++tmp;
            }
            else {
                tmp = 0;
            }
            num[i][j] = tmp;
            //cout << i << ", " << j << ": " << co[i][j] << ", " << tmp << endl;
        }
    }
    for (int j = 0; j < M-1; ++j) {
        vector<long long> vec;
        for (int i = 0; i < N-1; ++i) vec.push_back(num[i][j]);
        chmax(res, LargestRectangle(vec));
    }
    
    return res;
}

int main() {
    while (cin >> N >> M) {
        for (int i = 0; i < N; ++i) cin >> S[i];
        cout << solve() << endl;
    }
}




Measured memory_bytes: 38912