Cow Hopscotch (Bronze)#11178

Cow Hopscotch (Bronze)

1 second
128 megabytes
Medium

Just as humans enjoy playing the game of Hopscotch, Farmer John's cows have invented their own version of the game. Played by clumsy animals weighing nearly a ton, Cow Hopscotch almost always ends in disaster. Surprisingly, however, this has not deterred the cows from playing nearly every afternoon.

The game is played on an by grid, where each square is colored either red or blue. The cows start in the top-left square and must reach the bottom-right square by making a sequence of jumps. A jump is valid if and only if:

Please help the cows determine the number of different sequences of valid jumps that take them from the top-left square to the bottom-right square.

Input

The first line contains two integers and c~(2 \le r \le 15, 2 \le c \le 15). The next lines each contain characters. Each character is either '' or '', indicating a red or blue square, respectively.

Output

Print the number of different ways to jump from the top-left square to the bottom-right square.

Examples

Example 1

Loading
Loading