Run

Run

Unfortunately XORin's spell wasn't powerful enough and now he has to run from his evil enemies. He finds himself in the upper left corner of a rectangular grid of size NxM. Some cells are inaccessible. XORin doesn't know how to run up or left so he has to find the longest path so that he runs only down and right and he passes only through empty cells.

Input

On the first line of the input there will be the numbers N and M representing the size of the grid.
On the next N lines will be M characters representing the structure of the grid. The character . represents an empty cell and & represents an inaccessible cell.

Output

Print the maximum number of cells XORin can visit.

Constraints

1 ≤ N, M ≤ 100

Sample

InputOutput
4 4
..&.
..&.
..&.
..&.
5
Questions?

Sponsors Gold