Implemented Incorrectly

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Consider the following problem:

  • You are given a permutation A=a_1,a_2,,a_nA = \langle a\_1, a\_2, \ldots, a\_n \rangle containing each integer from 11 to nn exactly once. Find its only cyclic shift that starts with 11.

Consider the following algorithm to solve it:

  • Input: A=a_1,a_2,,a_nA = \langle a\_1, a\_2, \ldots, a\_n \rangle.
  • For each i=2,3,,ni = 2, 3, \ldots, n:
    • if a_i<a_1a\_i < a\_1:
      • rotate AA to move a_ia\_i to the front; that is, set Aa_i,a_i+1,,a_n,a_1,a_2,,a_i1A \leftarrow \langle a\_i, a\_{i+1}, \ldots, a\_n, a\_1, a\_2, \ldots, a\_{i-1} \rangle.
  • Output: A=a_1,a_2,,a_nA = \langle a\_1, a\_2, \ldots, a\_n \rangle.

You are given a single integer nn. Find the number of permutations on which the described algorithm solves the problem incorrectly.

입력

The only line contains a single integer nn (1n421 \le n \le 42).

출력

Print the number of permutations on which the described algorithm works incorrectly.

힌트

In the first example test case, for n=3n = 3, the only permutation resulting in an incorrect output is 3,2,1\langle 3, 2, 1 \rangle. The algorithm returns 2,1,3\langle 2, 1, 3 \rangle, while the correct answer is 1,3,2\langle 1, 3, 2 \rangle.