N-Queen

No attempts yetTime limit10sMemory limit128 MB

Problem

The N-Queen problem asks for placements of NN queens on an N×NN \times N chessboard in which no queen attacks another. A queen attacks every other queen in its row, in its column, and on its diagonals.

Given NN, write a program that counts the placements of the NN queens. Placements that coincide after a rotation or a reflection are counted separately.

Input

The first line contains NN (1N<151 \le N < 15).

Output

Print the number of placements of NN queens in which no queen attacks another.