Dominant Queens#4450

Dominant Queens

1 second
64 megabytes
Easy

On an 8 \times 8 chessboard, it is possible to position queens such that every square is either occupied by a queen or under attack by one.

Given the coordinates of one specific square on the chessboard, your task is to determine how many ways you can place additional queens on the remaining squares so that, along with the queen on the given square, they form a dominating configuration.

Input

The input consists of the coordinates of one square on the chessboard.

Output

The output should be a single integer: the number of possible arrangements.

Examples

Example 1

Loading
Loading