Description

As we all know, cows love novelty. So many times we are called upon to help them avoid duplication of effort or scenery. Another important question has appeared.

Betsy is happily grazing in a field of R (1 <= R <= 20) rows by C (1 <= C <= 30) columns of both grass plots (denoted by '.') and rocky plots (denoted by 'R'). Plot (1,1) is in the upper left corner of this grid. The sun is going down, so it's time to head back to the barn, which is south and east of Betsy.

Betsy wants to take a new route to the barn every night. She can't walk on the rocky plots at all and will only travel south (larger row) and east (larger column) toward the barn, never north or west. Please calculate how many evenings she can amble to the barn on a new route before she has to repeat a route taken earlier.

As an example, consider this layout of Betsy's pasture:

           B . . .       B = Betsy    . = plot for walking
           R . . .       R = Rocks
           . . . B       B = Barn
Here are the six ways she can walk to the barn:
B## . .    B## . .    B#### .    B## . .   B######   B#### .
R # . .    R ### .    R . # .    R #####   R . . #   R . ###
. ####B    . . ##B    . . ##B    . . . B   . . . B   . . . B

Input

The input file contains multiple test cases, for each test case:

* Line 1: Two space-separated integers, respectively: R and C

* Lines 2..R+1: Line i+1 represents row i and contains C space-separated elements that represent plots in the field. The first element is the element in column 1 of row i. Each element is a 'B', 'R', or '.' as above. The 'B's are unambiguous.

Process till EOF.

Output

For each test case, output:

* Line 1: A single integer that is the number of unique paths from Betsy to the barn. The answer will not exceed 2,000,000,000.

Sample Input

3 4
B . . .
R . . .
. . . B

Sample Output

6

Source

USACO 2006 March