#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main() {
  int h, w;
  cin >> h >> w;

  int ans = max(h, w);

  vector<vector<int>> a(h, vector<int>(w));
  for (int i = 0; i < h; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < w; j++) {
      a[i][j] = s[j] == '#';
      if (i > 0 && j > 0) {
        a[i - 1][j - 1] ^= a[i][j] ^ a[i][j - 1] ^ a[i - 1][j];
      }
    }
  }

  vector<int> y(w, 1);
  vector<int> left(w);
  for (int i = 0; i < h - 1; i++) {
    vector<int> t;
    for (int j = 0; j < w; j++) {
      if (j == w - 1) {
        y[j] = 0;
      } else if (a[i][j] == 1) {
        y[j] = 1;
      } else {
        y[j]++;
      }
      while (!t.empty() && y[t.back()] >= y[j]) {
        ans = max(ans, (j - left[t.back()]) * y[t.back()]);
        t.pop_back();
      }
      left[j] = t.empty() ? -1 : t.back();
      t.push_back(j);
    }
  }

  cout << ans << endl;
}
