The N-Queen problem asks for placements of N queens on an N×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 N, write a program that counts the placements of the N queens. Placements that coincide after a rotation or a reflection are counted separately.
The first line contains N (1≤N<15).
Print the number of placements of N queens in which no queen attacks another.