Problem: We have a board with an H \times W grid. Each square in the grid is painted in black or white. The square at the i-th row from the top and j-th column from the left is black if the j-th character in S_i is `#`, and white if that character is `.`.

Snuke can perform the following operation on the grid any number of times:

* Select a row or column in the grid, and invert the color of all the squares in that row or column (that is, black squares become white and vice versa).



Then, Snuke draws a rectangle along grid lines. Here, all the squares contained in the rectangle must be painted in black.

Find the maximum possible area of Snuke's rectangle when the operation is performed optimally.

Constraints

* 2 \leq H \leq 2000
* 2 \leq W \leq 2000
* |S_i| = W
* S_i consists of `#` and `.`.

Input

Input is given from Standard Input in the following format:


H W
S_1
S_2
:
S_H


Output

Print the maximum possible area of Snuke's rectangle.

Examples

Input

3 3
..#
##.
.#.


Output

6


Input

3 3
..#
.
.#.


Output

6


Input

4 4
....
....
....
....


Output

16


Input

10 8
...#.#
...#.#
..###.#.
.##.#.#
.#..#.#.
..##.#.#
.#.#..
...#.#..
.#.##
..###


Output

27

Solution (in CPP):

Solution:
/*
进行列的翻转操作之后，合法的矩形一定满足每一行的颜色都相等（无所谓黑白，因为可以有行操作来调整）
每一行颜色相等等价于该行任意相邻两个格子颜色相等，等价于两个格子对应的列的翻转情况是 / 否相等
相当于有一些限制，同时两个相邻格子对应的列在每一行的限制都相等 
故可以直接转化成一个最大子矩形问题 
*/

#include <stack>
#include <cstdio>
#include <algorithm>

using namespace std;
const int Max_NM(2050);

int N, M, rev[Max_NM][Max_NM], up[Max_NM][Max_NM];
char S[Max_NM];

void init()
{
	scanf("%d%d", &N, &M);
	for (int i = 1;i <= N;++i)
	{
		scanf("%s", S + 1);
		for (int j = 2;j <= M;++j)
			rev[i][j] = (S[j - 1] != S[j]), up[i][j] = (rev[i][j] == rev[i - 1][j] ? up[i - 1][j] : 0) + 1; 
	}
}

int L[Max_NM], R[Max_NM];
void work()
{
	int Ans(N);
	for (int i = 1;i <= N;++i)
	{
		stack<int> S;
		for (int j = 2;j <= M;++j)
		{
			while (S.empty() == false && up[i][S.top()] > up[i][j])
				R[S.top()] = j - 1, S.pop();
			S.push(j);
		}
		while (S.empty() == false)
			R[S.top()] = M, S.pop();
		for (int j = M;j >= 2;--j)
		{
			while (S.empty() == false && up[i][S.top()] > up[i][j])
				L[S.top()] = j + 1, S.pop();
			S.push(j);
		}
		while (S.empty() == false)
			L[S.top()] = 2, S.pop();
		for (int j = 2;j <= M;++j)
			Ans = max(Ans, up[i][j] * (R[j] - L[j] + 2));
	}
	printf("%d", Ans);
}

int main()
{
	init();
	work();
	return 0;
}