Measharans have a popular board game about placing L-shaped pieces on a rectangular board. The board consists of normal squares and special squares. Each piece has the same shape and covers three squares, like on the picture. Pieces can be put only on normal squares.
We would like to fill the whole board with our pieces. We would also like to know the number of possible ways of doing this.
The first line of input contains two numbers and , . These two numbers denote dimensions of the board.
Each of the following
lines contains
characters, . or #. Dots represent normal
squares, and # signs represent special squares.
Output the number of different partitions into L-shaped pieces. If it is larger than , output instead.
Input
4 5 .... ..#. .... .... ...#
Output
4