Peaceful Queens#4445

Peaceful Queens

1 second
64 megabytes
Very easy

On a standard 8 \times 8 chessboard, it is possible to arrange queens such that none can attack another. Your task is to extend this concept to a chessboard of size n \times n and determine how many ways you can place queens so that no two queens threaten each other.

Input

The input consists of a single natural number , where does not exceed .

Output

The output should be a single integer representing the number of distinct arrangements of queens on an n \times n chessboard where no two queens can attack each other.

Examples

Example 1

Loading
Loading