Module: Dynamic programming. Basics


Problem

5 /5


King

Problem

Domovoy Kuzma loves to play checkers on an 8x8 board. When no one wants to play with him, he just sits and thinks. For example, now he is trying to calculate how many there are ways to push a white checker to the kings, if it is alone on the board?
(The white checker moves diagonally one cell up-right or up-left. The checker goes to the kings if it hits the top horizontal.)


Input

Two numbers are entered from 1 to 8: the number is the number of the column (counting from the left) and the row (counting from the bottom) where the checker originally stands.


Output

Print one number - the number of options.

 

 

Examples
# Input Output
1 3 7  2
2 18 1
3 3 6 4