Queens Problem#333

Queens Problem

1 second
64 megabytes
Easy (≈1000)

You are probably familiar with the classic queens placement problem: on a N\times N chessboard, queens must be placed such that no two queens can attack each other. This kind of arrangement is called a peaceful arrangement. However, in this problem, we are interested not in a specific peaceful arrangement, but in all possible peaceful arrangements. More precisely, it is required to find their total number. For example, on an 8\times8 board, there are 92 different peaceful arrangements of the queens.

Input

The input file contains only one natural number (N \leq 12).

Output

In the output file, print the total number of sought peaceful arrangements.

Examples

Example 1

Loading
Loading