You have an $m$-by-$n$ grid of squares that you wish to color. You may color each square either red or blue, subject to the following constraints:
- Every square must be colored.
- Colors of some squares are already decided (red or blue), and cannot be changed.
- For each blue square, all squares in the rectangle from the top left of the grid to that square must also be blue.
Given these constraints, how many distinct colorings of the grid are there? The grid cannot be rotated.
输入格式
The first line of input consists of two space-separated integers $m$ and $n$ $(1 \le m, n \le 30)$.
Each of the next $m$ lines contains $n$ characters, representing the grid. Character `B` indicates squares that are already colored blue. Similarly, `R` indicates red squares. Character `.` indicates squares that are not colored yet.
输出格式
Print, on a single line, the number of distinct colorings possible.