As part of the navigating system, sometimes you need to know just how many paths there are from point A to point B, and not just the shortest. When some route is blocked by an unforseen construction activity, you often need to reroute. Roads are a dynamic scene, and your planned route could end up obstructed. In such cases it is rather helpful to know the total number of possible paths.
We can model a simple starting version of the above problem as follows.
You are given an
The first input line has an integer
After this, there are .
denotes an empty cell, and *
denotes a hole.