Dynamic programming

20.4 - Possible paths


Your task is to create a program that calculates the number of possible paths to go from the start (0, 0) to the finish (C - 1, R - 1).

Sample Input

3 4
0 0 0 0
0 1 0 0
0 0 0 0

Sample output

4