e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Rooks on a chessboard

Rooks on a chessboard

prb1327

From the childhood little Garik was interested in a question: in how many ways n rooks can be arranged on the chessboard of size n × n so that they do not hit each other. He was solving this puzzle for a long time for each case, and when he solved the problem - he gave up the chess.

And how fast can you solve this puzzle?

Input

The size of the chessboard - a positive integer not greater than 1000.

Output

Print the answer, found by Garik.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2
Output example #1
2
Author Анатолий Присяжнюк